I know the question is quite long and difficult to understand. Whatever is the option on #1 question, you surely needs to use some kind of layer model to make this sprite or animation to starts closer to the player's view and later change to far away from player's view. At the beginning of the animation, his right hand is close to the user's view and then, at the middle of the movement, this is probably behind the character's body on the animation. Let's consider a character move where he spins 360 degrees with his arms open. This surely influence the answer of #1 question. It means at least 3 different positions for each head equipment (helmet, cap, whatever). If we consider one part of the user, like his head for example, it starts in front and then turns left. Let's say during one of the character's move he starts looking directly in front to the player's view but ends his movement showing his right side to the player (like if he swings his sword from one side to the other). Is there any other better option? (I really don't like the ideas above) Is it better to just have the equipment sprite and animate it directly on code like rotating and translating (using something like tween on Flash)? Should I create different sprites for each equipment in each action animation? I see a few problems that I'd like to know the best approach/algorithm/architecture to solve. So let's say the user changes his/her shoulders and pants, this must be shown to the player and all these different equipments must follow the different characters action (hitting, being hit, spelling magic, etc.). Select a Sprite or any node with texture property and in Script Editor do File -> Run to generate a palette template.Ĭheck the example project for some usage examples or check the repo for more details.I want to create a 2D game but I'd like to have the character to wear tons of different equipments on different combinations, like a RPG or something. It's an editor script for quick generating palettes from images. The shader comes bundled with a file PaletteGenerator.gd. Also, while the palette size is only limited by maximum texture size, having too many columns (hundreds/thousands) will impact performance. Warning: Be sure to import all used textures with "filter" disabled, otherwise the shader won't work properly. Only RGB values are sampled, alpha is used only for final image. When using palette alpha, keep in mind that transparent pixels are sampled too. You can use the alpha from palette colors or keep the original. I also made sure that the code is optimized. It uses integer comparison for the colors, so it's fast and perfectly accurate. The shader will automatically adjust to palette size, so it requires minimal setup (just drop palette image and it works). 2-row palette with first row skipped results in a static palette swap. By default, the reference row is also part of the animation, but it can be skipped. The shader will cycle between palette rows, resulting in an animation. Top row of palette are color references these colors are sampled from the original image and replaced by colors from subsequent rows. Palette swap shader with animation support 1.0 Shaders 3.4 CommunityĪ shader that changes sprite colors based on provided palette.
0 Comments
Leave a Reply. |