Cropping of quads easily? Anim8 / Walt library
Posted: Fri May 04, 2018 2:07 pm
Hey guys,
So I have been thinking of usecases where I want to use an animation library for all my entities in my game.
For Anim8 specifically, there are a set number of "grids" attached to images, and entities all have their own Animation which is basically a set of instructions of how the animation works (play frames 1 to 5 on grid1 for image1.png).
My use case, is I want to be able to crop / slice / cut a part of an image, as in, not display a fraction of the image, this being in constant dt time, so a healthbar image will decrease the top of the image as health decreases from 100%, back to 100%.
So let's assume we have 100 by 100 pixel image. I want to add 1 to the y, and subtract 1 from the height of the frame of the image, so the image goes from 100% to 99% all the way to 0, where it disappears. I've implemented this manually in an SDL2 game because all the properties of the "grid" and it's frames were accessible, but:
I don't see how this is possible in native Anim8, or Walt, or any other library. I know Quads can do this with maybe something like paste?
Basically I'm a bit lost as the best way to about about implementing this without me having to rewrite my own animation library. If I have to write custom code specifically for the few entities that require this cropping I think that's fine.
So I have been thinking of usecases where I want to use an animation library for all my entities in my game.
For Anim8 specifically, there are a set number of "grids" attached to images, and entities all have their own Animation which is basically a set of instructions of how the animation works (play frames 1 to 5 on grid1 for image1.png).
My use case, is I want to be able to crop / slice / cut a part of an image, as in, not display a fraction of the image, this being in constant dt time, so a healthbar image will decrease the top of the image as health decreases from 100%, back to 100%.
So let's assume we have 100 by 100 pixel image. I want to add 1 to the y, and subtract 1 from the height of the frame of the image, so the image goes from 100% to 99% all the way to 0, where it disappears. I've implemented this manually in an SDL2 game because all the properties of the "grid" and it's frames were accessible, but:
I don't see how this is possible in native Anim8, or Walt, or any other library. I know Quads can do this with maybe something like paste?
Basically I'm a bit lost as the best way to about about implementing this without me having to rewrite my own animation library. If I have to write custom code specifically for the few entities that require this cropping I think that's fine.