Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tigre Pablito

Pages: 1 2 3 [4] 5 6 ... 15
46
DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 24, 2018, 03:50:05 am »
My first problem is solved, that is, when my poor games start, the window automatically gains focus ...

But what about if it lost focus while the game is running? ... I have to click on the screen ... also it is a bit annoying that a window appears or for some reason the game window loses focus

So it would be very nice that comes the SetFocus() function for SFML.Net to be able to regain focus when it's lost (I saw there is a LostFocus event, that would be used with it) ... If I understood well it will be added to next .Net update ... I hope so

47
DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 23, 2018, 01:45:24 pm »
No, RequestFocus doesn't focus the window, it just request you to focus it, flashing its icon in the task bar with a yellow tone, like when you're debugging your app with Visual Studio and it stops at an exception.

I just was able to get the window focused when creating it (when the game starts), by changing the app target type.

But there isn't any SetFocus() function in SFML.Net for now. That would be useful in case the app loses focus while the game is running. So let's wait for SFML.Net update  :)

48
DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 23, 2018, 03:30:52 am »
Hi Laurent

I already found the way to solve the issue of focus stolen when the game starts. My apps were of console type, and then the console box stole focus to the window. Now I changed to Windows application and it starts focused.

However, if the window lose the focus, it seems (for SFML.Net) it isn't possible to regain it from the code. As you said, we'll have to wait for the .Net update. (I searched the setFocus() function and there isn't. Rarely, there are RequestFocus(), that works fine, and another I don't remember)

I hope the SFML.Net update comes soon  :D

Thanks

49
DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 22, 2018, 07:21:43 pm »
Hello eXpl0it3r

If the function for focussing the window is not SetActive() I suppose the code example with it won't help us too much to solve the issue  ;D

If you could tell me which is the function that really does, it would be very nice and then if it fails, I will make the code example. Thank you!  :)

50
DotNet / Re: SFML.Net setting window active AND music loop points
« on: May 22, 2018, 03:48:24 pm »
Quote
the issue about setting the window active (RenderWindow.SetActive() method)
What issue?

When my poor games start, I have to click on the screen, if not, they don't respond to events (keyboard, etc). So I call window.SetActive(); but it seems it does nothing. So what I would need is a way to prescind of clicking on the screen to activate it. Maybe I'm wrong and that is not the function I have to call.


51
Hi Ladies and Guys

I would like to know if sometime the issue of setting window active or focussed and the one about Music loop points will be fixed/added to SFML.Net.

And, once again, I'll give an opinion: I don't think threats are the way for asking for something. Even less, that granting the requested thing is a way to respond a threat or a push. Clippboard support, as Laurent said from the beggining of that thread, has nothing to do with a multimedia library. But because of the push of some members, one of those that prompted others to switch to SDL, it seems that "feature request" has been started to develop/add to SFML. I wonder when the developer(s) and the SFML Team will stop fearing these kind of movements and characters, and just continue doing what they do the best (the multimedia library, SFML). I anyone wants to switch to SDL or whatever it was, then GO to SDL or where they want if they like it more. Nobody is forced to stay in SFML if he/she likes SDL more. But, as I saw, that member doesn't seem to think that SDL is better. I say this with no intention to offend anyone.

But why I say this? Because there are issues that really have to do with a multimedia library, such as the ones I mention here, that don't bring threats and are not too difficult to do. And, obviously, because I actually think that if someone(s) say(s): "Do this, or I will go to another place", I would reply "Go to another place". Other case would be if someone say "Would you please do this? (And thanks for what you have already done)".

Pablo

52
DotNet / SFML.Net setting window active AND music loop points
« on: May 17, 2018, 03:31:59 am »
Hello Ladies and Guys

I would like to know if sometime, the issue about setting the window active (RenderWindow.SetActive() method), and the feature about (Music) Loop points, both of SFML.Net, will be addressed.

Thanks

53
General / Re: Handle multiple pressed Keys in a switch statement
« on: May 16, 2018, 03:52:06 pm »
                        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                        {
                                //Left rotation: If Left + Either Down or Up are pressed
                                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left) && (sf::Keyboard::isKeyPressed(sf::Keyboard::Down) || sf::Keyboard::isKeyPressed(sf::Keyboard::Up)))
                                {
                                        player->rotate(10);
                                }
                                else
                                {
                                        player->move_x(-10);
                                }
                        }

The first 'if' is not necesary because you check if Left is pressed in the 2nd one  ;) . Same with the check of the Right key

54
General / Re: How to mix two sprites?
« on: May 14, 2018, 02:38:38 am »
Hello (or good night here in Bs As)

I would try setting both images' alpha to half (128) and overlapping them

You can try this:

sprite1.Color = new Color(255, 255, 255, 128);
sprite1.Position = new Vector2f(someX, someY);
window.Draw(sprite1);

sprite2.Color = new Color(255, 255, 255, 128);
sprite2.Position = new Vector2f(someX, someY);
window.Draw(sprite2);
 

Hope this helps

55
Hi eXpl0it3r

I don't know if that PC (that is not mine) has the driver. I suppose it doesn't. Could you tell me where or how to find the missing GPU driver to install?

Thanks for your help

56
General / Re: What is the best way to group objects in SFML?
« on: April 27, 2018, 04:46:23 pm »
Hi

You can set the centre (x, y) around which the shapes will move, then decide the starting angle (in radians) of each shape (from the centre), and the distance, then on each frame each shape's (x, y) = (centreX + cos(angle) * distance, centreY + sin(angle) * distance) and increase angle (when angle >= 360 then angle -= 360). Also each shape's Rotation = angle (in degrees).

I think this is the best way.

Other is to draw the shapes to a RenderTexture and rotate it, but I don't think it's good.

57
Hi FRex

Now I remember, in that Windows 10 64 bit PC, I found out that what made the program crashes was all the Draw calls ... wether it was a text or a sprite ... it wasn't the screen mode ... or may be that the Draw calls made the program crash due to the screen mode?

I'll try to search for screen mode availability and VM (virtual machine?) ...

Thanks for your help

58
Dear Ladies and Guys of SFML

I tried to run my poor game on Windows 10 64 bit, and this error message showed up in the console box: "Failed to share OpenGL context". And below this, the famous "Attempt to read or write to the protected memory ...."

The game is created for 32 bit, and runs fine on Windows 7 (32 or 64 bit). I posted it on the SFML Projects forum.
Download link:
https://www.dropbox.com/s/3wy14x0jrgpaen7/Massacre%20A%20Poor%202D%20Space%20Shooter.rar?dl=0

Can anyone help me to solve this issue?
Thanks in advance

59
SFML projects / Re: Chess
« on: April 22, 2018, 03:27:47 am »
Hi

The 1st one is the logical part; 2nd is up to your IDE, libraries, and programming language.

As I have not the foggiest idea of the 2nd, I'll reffer to the 1st part.

You are in check mate, if and only if, you can't avoid your king being taken by any of the opponent's pieces, whatever it is the piece you move (not only your king), each other, to any of all its allowed lockers.

So, you would have to evaluate, for each one of your (alive) pieces (that you may have in a List<> or vector in C++), for each one of their possible moves, if you remain in check. If moving ANY of your pieces, WHEREVER they can move to, does not annul the check (*), then you are in check mate. I would recommend start the search by finding if any of your pieces can take the opponent piece that is threatening your king (and then verify if you are still in check - it may happen that you can take the piece which points to your king, but moving that piece of yours, unblocks it from an aligned opponent's rook - SO, for EACH possible move of ALL your pieces, it's necesary to do a complete test). If this is not posible, then I would continue verifying if a move of your king might annul the check. If there isn't, then you would have to check all of your pieces' allowed moves in order to find out is there is any way to block the threat. If you find any way to annul the check, then stop there the function process returning false (you were not in check mate).

By the way, for this, previously, you would need a function to determine if you are in check. This is not as simple as anyone might think quickly. You are in check when one opponent piece is at one move of taking your king. But this does not occur only if your opponent aligns a rook, or a bishop pointing to your king. It may also happen if he moves a piece, that was blocking another one of his, and then you are in check by a piece that was not moved.

Maybe all this is a bit complicated. I have to say that I play chess since I was a kid.
Feel free to ask if you have any more doubt

Pablo


60
Hi Jason

Just having seen the video I realize your project is very good, mainly for those who have to learn about multiplayer and networking. I'm going to read the tutorial.

I wish there was a copy (or binding) of the project to C# / SFML.Net.


Pages: 1 2 3 [4] 5 6 ... 15