Is MTE compatible with using .setFillColor in this way?

Hey Dyson,

It’d be awesome to let players customize their player’s colors like in this tutorial… but before .setfillcolor actually can work, we must use:

player.sprite.lighting = false

which won’t really be effective, because we want the cool dynamice lighting over the colored player. How would you approach this?

http://coronalabs.com/blog/2012/10/09/dynamically-optimized-sprite-sheets/

Thanks Dyson,

BTW, I think you should charge more than $35. 

Steve,

This is what I am currently doing in my project and it works very smoothly.  I have a bunch of different graphics and the player can customize their own character.  Now that I’m trying to use the lighting system that Dyson has in place Im kinda running into a snag.  Hopefully there is a solution.

-Curt

There is no solution right now, but adding one shouldn’t be too hard. I’ll see what I can do come Monday.

I really glad I found MTE Dyson. Thank you

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.

Steve,

This is what I am currently doing in my project and it works very smoothly.  I have a bunch of different graphics and the player can customize their own character.  Now that I’m trying to use the lighting system that Dyson has in place Im kinda running into a snag.  Hopefully there is a solution.

-Curt

There is no solution right now, but adding one shouldn’t be too hard. I’ll see what I can do come Monday.

I really glad I found MTE Dyson. Thank you

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.