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

Author Topic: Static sprite size on resize event  (Read 1502 times)

0 Members and 1 Guest are viewing this topic.

evil_twinkie

  • Newbie
  • *
  • Posts: 7
    • View Profile
Static sprite size on resize event
« on: January 26, 2011, 11:38:07 pm »
On Event::Resized (when someone clicks and drags the corner of the App window to be smaller/larger) all of my sprites and shapes get smaller/larger respectively.  Is there a way that I can disable this from happening?  I'm running an OpenGL visualization with sprites that make up my menu.

My code is a bit intricate to post right now, but later I can put together an example to better illustrate my question.  Thanks for the help.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Static sprite size on resize event
« Reply #1 on: January 26, 2011, 11:59:26 pm »
you could change the window view to the new size.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

evil_twinkie

  • Newbie
  • *
  • Posts: 7
    • View Profile
Static sprite size on resize event
« Reply #2 on: January 27, 2011, 12:11:41 am »
Nice, that did the trick!  Thank you.

Here's the code I added:

Code: [Select]

static sf::View view;
sf::FloatRect rect(0, 0, newWidth, newHeight);
view.SetFromRect(rect);
App.SetView(view);