[SOLVED] Way to have an animated object in a GUI?


I'm trying to include an animated sprite in my game as part of a GUI system, but the xview and yview options in the draw event only seem to draw one frame of the sprite.

I want a sprite to start at frame 0 and then end at frame 10, something I usually code in the create and animation end events of an object. I've tried including x = view_xiew and y = view_yview into the step event of my object and using the object for the GUI, but that has a very jittery and unclean effect.

Is there any easy way to achieve this? perhaps an animate and stop animation in the draw event when drawing a sprite with multiple indexes?


so 1 thing to remember is that in the draw GUI function it draws directly to the view, not relevant to the view or your position. This means that position 0, 0 will always be in the top left corner of your screen while in the draw gui event.

that being said the reasion for the gittery effect is because the draw gets updated after the step so what you really should do is make an object (with the sprite) and put this in the draw gui event:
/// Draw GUI
draw_sprite(sprite_index, image_index, 0, 0);
this will draw its own sprite and index (so its animated) but in the gui (no gitter)