Sign in to follow this  

2D animations with DirectX 9?

Recommended Posts

I'm trying to make the UI for my little game and I would add some animtions for the menu. I think that with something like scaleform would be easy to manage animations of the controls, etc but it's not free so I made my own DirectX 9 GUI system. The problem is, how can I manage the animations? I know that also XNA has something like a storyboard or something similar that allows developers to make animations.

Share this post

Link to post
Share on other sites
Well, dont really know if I got you right, but I cast you an explination on what I think I would have done.

My guess is that you want to make a normal animation thats run along while the game goes on as normal. Its several ways to do this and none of the ways is really a wrong way to do it.

[b]Modifiy the animation:
[/b]First guess is the easyest. You decide what should happen when, and if the flag for changing the animation is set, then just in the draw loop or the logic loop change image from the first image to next one in the set. This will work quite good, if the game has the same speed and not flexing alot.

The nice way is to the updates based on elapsed time since last update. Use a time counter to just see how long between the updates and when time is right update it or even skip frames in the animation if the fps go low.

My guess is that you would want a vector based gui so would suggest to change vectors based on time, an animation should take 1 sec. If vector is at 0x 0y and shall go to 1x 1y then ofcourse if the update is at 0.73 sec it should be positioned at 0.73x 0.73y.

Scaleform is a vector based menu system if I undestand it right, its quite easy to use and tbh not that hard to program your own. Just focus on make it scalable see it like drawing everything on a 2d surface where vectors are not hard coded position. They should just be relative to one position in your upper right corner for example on the GUI 2d surface. All animations is counted from that point and the size of the 2d area. Z-led can be changed later on just to move the surface in depth. An Ide is to get camera position to determin where the gui should be drawned and just position it where you like.

There where long time since I programmed dx, but my guess this should be the easyest way. :) Probebly wrong but it might is an ide that get you going atleast.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this