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 - Mugros

Pages: [1]
1
Window / [SFML2] Event Resized
« on: June 25, 2011, 05:02:53 pm »
ok, works now:
Code: [Select]
case sf::Event::Resized:
App.SetView(sf::View(sf::FloatRect(0, 0, Event.Size.Width,Event.Size.Height)));
break;

My C++ is a bit rusty and i forgot the breaks  8)
Gave a funny effect.

I guess SetSize should be used when changing the resolution with a game menu.

2
Window / [SFML2] Event Resized
« on: June 25, 2011, 04:46:04 pm »
I am having the same problem. The thing is, that without handling the Resized event, the window resizes fine but the rendering area is stretched.
So if i start with a 800x600 window and i make it bigger everything i draw is still mapped to a 800x600 area and stretched to the new window size.
I used the tutorial and work my way up. Right now i just draw a sprite at the mouse coordinates, like a pointer. After i resize the window the position of the sprite doesn't match anymore.
I looked on the website and found:
Code: [Select]
void SetSize (unsigned int Width, unsigned int Height)
  Change the size of the rendering region of the window.

And i thought that i have to adjust the rendering area to the new size. But like the OP said, this results in strange behaviour.

I guess i have to change the view, but couldn't make it work yet...

Pages: [1]
anything