GMS 2 [FEATURE REQUEST] Allow GML-access to sprite image layers

M

MikeVV

Guest
Feature Request:
Being able to toggle the visibility or adjust the alpha of a particular layer of a sprite-image through GML code would be very beneficial. Note that I'm not referring to a room layer, rather the layers that you can use in the GM Studio 2 Sprite Editor.

Use-case: Sprite image has Layer 1 which is the base-animation of a player sprite walking. Layer 2 through Layer N have additional optional equipment (helmets, armor, etc) that appear on top of the base animation. Being able to toggle the visibility of equipment layers on and off (through code) allows them to stay in-sync with the animation without having to create additional sprites or objects, so that at run-time the player can equip various items and the sprite reflects as such.
 

sp202

Member
You'd rather have dozens of layers on a single sprite rather than have it neatly separated out? I don't know about you, but this sounds like a fairly redundant feature to me.
 
M

MikeVV

Guest
You'd rather have dozens of layers on a single sprite rather than have it neatly separated out? I don't know about you, but this sounds like a fairly redundant feature to me.
Thanks for your reply. Yes, there is a means to accomplish what I want by drawing X number of sprites in the same position in the correct order. However, let's say I add a frame to the animation cycle. Now I have to add a frame to the animation cycle for the other sprites as well. Then to make sure everything lines up and animates well, I believe the easiest way would be to run the project and watch the animation cycle. With the sprite-image-layers, I can add a single frame, toggle on/off the image-layers I want to see, run the animation within the IDE, and adjust accordingly.

Additionally, let's say I have a different sprite-animation such as an attack animation. Now I need the same X number of sprites for the attack-sprite, adjust them to match the attack-animation, etc. rather than just adjusting the image-layers, and being able to make sure everything flows within the IDE image-editor.

It is a bit of a redundancy, but it would be tremendously helpful. If no others can see the use, I'll just have to work within the confines of the available features.
 

dirkinz

Member
What I would recommend is editing your sprites in an external editor (like Photoshop or the free GIMP2.0). That way you can save the project with all the layers in tact and whenever you change the animation you can re-export them. For GMS2 to do that they would also have to export each sprite as several image files anyways.
 
Top