var/icon/I=icon('player.dmi')
for(var/v in I.IconStates(2))
flick(v,src)
sleep(I.GetFrames(v,1,SOUTH))//Or something like that?
Problem description:
Is there anyway to tell how many frames an Icon has?
ID:788341
May 31 2012, 2:55 am (Edited by moderator on Jun 1 2012, 8:18 am)
(See the best response by Forum_account.)
|
|
Code:
var/icon/I=icon('player.dmi') Problem description: Is there anyway to tell how many frames an Icon has? |
May 31 2012, 3:00 am
Best response
|
|
I think there is, but you can't tell what the duration of each frame is. To determine how many frames there are, I think you can load each frame using the icon() proc (you can pass it a frame number). If you pass it a frame number that doesn't exist, there is some way you can tell (in not sure how off the top of my head and I don't have access to Dream Maker), so once you find a frame that doesn't exist you know the animation has fewer frames than that.
|
icon This is what I ended up with. I figured I'd keep the dir variable because sometimes some dirs have more states. [Might as well] Edit: -I ended up needing to figure out how long the state last for has anyone ever figured that out? |