FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Best Way to Scale an SIO2Widget

3 posters

Go down

Best Way to Scale an SIO2Widget Empty Best Way to Scale an SIO2Widget

Post  uprise78 Sat Jan 03, 2009 11:31 am

I would like to scale an SIO2Widget in/out and keep the center in the same location. Does anyone have any tips on what the best way to do this is?

uprise78

Posts : 228
Join date : 2008-10-31

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  meteors Sat Jan 03, 2009 12:33 pm

You could simply use:

glPushMatrix();
//scale down
glScalef(0.5, 0.5, 0.5);
sio2WidgetRender(my_widget);
glPopMatrix();


best,
-joshua
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  uprise78 Sat Jan 03, 2009 1:42 pm

I gave that a shot first and it ended up changing the position of the widget quite a bit and the touch event for the widget ends up being at the original location. I am thinking I may need to scale and change the position and possibly the widget flags as well...

uprise78

Posts : 228
Join date : 2008-10-31

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  sio2interactive Sat Jan 03, 2009 4:17 pm

Just create a widget with the SIO2_WIDGET_CENTERED flag ON and then use the pos property to place your object and size to scale it within your rendering loop.

That's all there is to it Wink

Cheers,
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  uprise78 Sat Jan 03, 2009 7:49 pm

Man, that's almost too easy. Thanks sio2.

uprise78

Posts : 228
Join date : 2008-10-31

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  sio2interactive Sat Jan 03, 2009 7:53 pm

Hehe no prob Wink
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Best Way to Scale an SIO2Widget Empty Re: Best Way to Scale an SIO2Widget

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum