Game Development Community

Help in gui Rotate Control

by Israel Lazo · in Technical Issues · 04/10/2006 (1:10 pm) · 2 replies

Hi after some heavy search i finally decided to post for help
My problem is as follows:
I want to create a small window in the Gui where you can view the pictures of a product, the pictures are taken as if the product was rotating. Now i have two buttons one to rotate left and one to rotate right they both call a function changeImg() with the parameters left and right and the image flipping is done correctly but i need to leave the product rotating when you leave the button depressed. I have tried setting the onPreRender function to check if depressed (part of GuiButtonCtrl.cc) is true and if it is to call changeImg again of course with some time interval but it doesnt work, I dont know how to get this to work and i could'nt find anythin usefull in the documentation documentation.
I also have another problem but this one is simpler i need a carriage return in the GuiTextCtrl so that I can enter formatted text because \n\r just prints a block because it does'nt find a font to render it
I hope you can help me
Thanks in Advance

#1
04/11/2006 (11:40 pm)
If you are trying to flip through the pictures in script, I would suggest writing a method that loads the next image and then calls a schedule event to allow another change in the displayed picture. I don't have any code to present you with, and this all depends on how many pictures and the speed which you will be flipping through the images. Doing this in script may be too slow if you have a lot of pictures to flip through...

It sounds like you are attempting to do this from the engine code already, so this may not be a feasible solution for you since you already have changed other parts.
#2
04/13/2006 (7:00 am)
Thanks Jon, I actually got it working using schedules and it works like a charm does somebody want code for this??