RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Animations?

FrostBarge

Wanderer
Animations?

How would one code a line to show an animation as an image? Heres what I got so far but no luck



Code:
this.pictureBox2.Image = Ultima.Animations.Translate(1);

If someone could show me the basics I can figure out how to do the rest thx
 

a_dahaka

Wanderer
Translate is just for translating the body Id. You can then put the body id into GetAnimation to get the frames for the animation. The image is shown from a specific frame.

This gets action 4 (I forget what that is now) for body type 987 (Counselor/GameMaster), facing North, with hue 0x8485 (deep red). Put this into a form with a picturebox and it will show the first frame.

Code:
Frame[] frames = Animations.GetAnimation(987, 4, 1, 0x8485, true);
this.pictureBox1.Image = frames[0].Bitmap;
 

Revan

Sorceror
Just increase the value of the array there yeah, can use a timer or whatever to get the speed you want.

( example: )
Code:
private int currentFrame = 0;
Inside a timer:
Code:
this.pictureBox1.Image = frames[currentFrame].Bitmap;
currentFrame++;
 
Top