![]() |
|
about animation |
keprast
Member #16,794
January 2018
|
Using a shear in Allegro.You just need to load a picture. But I believe there's a simple way to do it. If have a weapon that a soldier can switch. There's always a way to do it.Not just that. |
Rodolfo Lam
Member #16,045
August 2015
|
Sir I honestly have difficulties understanding your questions, but generally animations are just that, a collection of images being shown in quick succession. It can be as simple as you would like it to be, but still you need to code it on your own, as Allegro does not directly support doing animations automatically. It just provides the tools for you to do it. You have sub-bitmaps, clipping rectangles, loading individual images and flipping through them, etc. While a Timer could be used specifically for this, it may be Overkill having another time apart from your main tick timer, which could be used o drive the flipping of the animations.
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Animation is pretty easy if you keep it simple. AnimationBase.cpp You can take out the EagleEventSource and ANIMATION_EVENT_DATA and WidgetMessage stuff if you remove these functions : Then all you do is derive a class from AnimationBase and redefine the OnSetAnimationPercent function. And in there all you have to do is set a redraw flag, and pick what to draw based on the current frame number. It would be very easy to port this to C as well. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|