GameMaker: Studio

GameMaker: Studio

Ver estadísticas:
Animation in Draw GUI event?
Hi. I've used the Draw GUI event to draw button sprites but how would I manage to make a particular sprite play a sequence of its subimages (animation) and then stop? I used "draw_sprite (spr_zoom_button_in, 0, 5, 5)" but this only draws a single subimage, in this case subimage 0...
< >
Mostrando 1-4 de 4 comentarios
disKO 24 AGO 2013 a las 13:43 
I haven't used this new Draw GUI thing yet, so sorry if this doesn't help.

Replace 0 with a variable.
For example, in the Create event make a variable that represents the subimage you want shown.
Like... ButtonSubImage = 0
then in your step event you could do something like,
if ButtonSubImage != 5 ButtonSubImage += .3

I could help out more but I don't know how fast ya want the animation to go, or how many frames are in the animation or what the room speed (frames per second) is.
Última edición por disKO; 24 AGO 2013 a las 13:43
Scarabian 25 AGO 2013 a las 5:15 
In order to stop an animation running set the image_speed to 0 to start it animating set the image speed>0 the higher the speed the faster the animation. to stop the animation again set the image_speed to 0. In order to play a few images and stop:
Image_speed=0; image_index=3 image_speed = 4 if image_index = 8 { image_speed=0 }
so we start with a sprite with no speed on the animation we set its image to the first one we want in our animation. We play the animation at our chosen speed then finally when we reach the last image in our animation we stop the animation again.

Hope this helps
Steve
regardtvisagie 25 AGO 2013 a las 12:54 
Thanks, got it, both replies helped.
disKO 28 AGO 2013 a las 15:58 
Publicado originalmente por Scarabian:
Image_speed=0; image_index=3 image_speed = 4 if image_index = 8 { image_speed=0 }

Scarabian how you get yo code in a nice little box like that?

EDIT: Oh lol it says the BB code whenever I quoted ya.
What other tricks you got up yo sleeve?
Última edición por disKO; 28 AGO 2013 a las 15:59
< >
Mostrando 1-4 de 4 comentarios
Por página: 1530 50

Publicado el: 24 AGO 2013 a las 2:26
Mensajes: 4