Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 01-07-2005, 05:17 PM   #1 (permalink)
 
Join Date: Dec 2004
Age: 25
Posts: 58
Default 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
FrostBarge is offline   Reply With Quote
Old 01-07-2005, 05:44 PM   #2 (permalink)
 
Join Date: Dec 2003
Location: Northwestern Pennsylvania
Posts: 183
Default

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;
a_dahaka is offline   Reply With Quote
Old 01-07-2005, 06:51 PM   #3 (permalink)
 
Join Date: Dec 2004
Age: 25
Posts: 58
Default

worked perfectly, thx. but on making it animate would I run a loop through the array?
FrostBarge is offline   Reply With Quote
Old 01-08-2005, 02:12 PM   #4 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

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++;
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5