Animations
- Login to post comments
Wed, 02/15/2012 - 02:24
I haven't been working too much lately and I apologize. School and all that. While trying to get back into it, I was thinking about what needed doing. I remembered I still needed to figure out a way to coordinate animations, so I begun work on that.
A few minutes got me this template:
<anim id="anim1" fcount="4" path="data/images/utility/anim1.png" loop="true"> <frame order="1" x="0" y="0" w="150" h="150" time="1" /> <frame order="2" x="150" y="0" w="150" h="150" time="1" /> <frame order="3" x="0" y="150" w="150" h="150" time="1" /> <frame order="4" x="150" y="150" w="150" h="150" time="1" /> </anim>
It goes along with this image which is 300x300 split into four perfect squares. I think it's pretty straightforward. "time" is in seconds.
Would this template work for you guys? If not, feel free to give suggestions. I want to find a template that would be good for everyone. Any questions are welcomed. This is what I'm hoping to finish for this weeks release, by the way.
EDIT: Oh, and Dear Esther was just released. This is the second release from Indie Fund!
I think this would work well: easy to understand, simple to use. What would make it even simpler would be if, once we actually start putting stuff together, someone makes a small app that generates such XML automatically, and you only need to input parameters. Things like x, y, w, and h would be much easier and simpler to acquire.
Also, don't forget that we'll likely need transparency. Or is that handled elswhere?
New GooFans Rules | My Addins
If you want the whole image for a frame, you put 0x/0y/300w/300h. I think putting a larger width and height would also take the whole image but it might allocate more memory than it needs.
That kind of tool sounds handy. I'll think about making one; I'm always worrying about what you all, the builders, would like to use for tools. For now I'll worry about the engine itself though.
Transparency is done according to opacity on the PNG itself.
I tweet like a bird
I have a lame website
Looks good. Is
time
an int or a double?Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
Double obviously. An int would be ridiculous.
I tweet like a bird
I have a lame website
Just wondering if you planned some interpolation or something.
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
A double would be easier. I could easily integrate it into the frame counter. I just have yet to create an algorithm for figuring out which frame to begin drawing the new image in.
I tweet like a bird
I have a lame website
Not if it were a millisecond counter.
I don't think SDL has a way to change alpha, but being able to keyframe an "active" flag or something like that may be a good idea (active=false means the object isn't drawn). This way you can make an object blink or stuff like that.
IRC | Chapter Tutorial | Reference Guide
Well, if it were a millisecond counter, you might want an unsigned long long instead.
Actually, I take that back. Presumably everyone will have 32-bit computers.
But couldn't you do the "blinking" by blanking out every other frame?
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
Exactly, the transparency is PNG-based, but I guess I can have an
<emptyf>
element that is a frame without any visual representation. That sound good?I tweet like a bird
I have a lame website
32-bit computers? Both of mine are 64-bit.
IRC | Chapter Tutorial | Reference Guide
Most of my friends have 32-bit. All three of mine are 64-bit though. I guess it depends on how you were raised.
I tweet like a bird
I have a lame website
64-bit here as well. But we shouldn't rely on all our users to have it.
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
Recently got 64-bit too. But all others in our family is 32-bit, and we only got 64-bit on this one because we realised that we weren't using our 4GBs of RAM, and we had to reinstall Windows anyway. When I get my own I'll probably only get 64-bit if I have more than 3GB of RAM, which is likely.
I might be able to make it in Adobe AIR, if/when we need it. Unless anyone else would rather do it. But as you said, we should get the engine done first: you might decide to change this method of animation altogether.
New GooFans Rules | My Addins
Sweet. When the next update arrives, we'll see if we like how it turned out.
I tweet like a bird
I have a lame website