Best Way to Scale an SIO2Widget

View previous topic View next topic Go down

Best Way to Scale an SIO2Widget

Post  uprise78 on 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

View user profile

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  meteors on 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
avatar
meteors

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

View user profile

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  uprise78 on 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

View user profile

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  sio2interactive on 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,
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  uprise78 on Sat Jan 03, 2009 7:49 pm

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

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  sio2interactive on Sat Jan 03, 2009 7:53 pm

Hehe no prob Wink
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: Best Way to Scale an SIO2Widget

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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