Alright, that was pretty straightforward. I’ve modified MTE to accept a new color parameter for sprites which you can set in the setup table or apply to each sprite manually. For example sprite.color = {255, 100, 50} will turn the sprite reddish in color. If your sprite is a group composed of sprites you can set group.color to color all children, or you can color each child individually. For example:
local player = display.newGroup() display.newSprite(player, spriteSheet, sequenceData) player[1].x = -16 player[1].color = {250, 150, 0} display.newSprite(player, spriteSheet, sequenceData) player[2].x = 16 player[2].color = {56, 187, 200}
The new modifications also allow you to enable lighting on these sprites. This functionality will be available in the next update on Friday.
Why the color parameter? Why not just use setFillColor? The issue here is that there’s no way to retrieve the colors from a display object. There is no “getFillColor” function that I’m aware of. The engine has to store the true color of a sprite so that it can blend it with the level and tile lighting. Setting the color parameter achieves this. MTE can tint the sprites as needed while referring back to the color parameter for their intended true color. You can change this color parameter at any time as needed.