It looks like you're new here. If you want to get involved, click one of these buttons!
local uiX = 10 local uiY = 10 colors = { {50,100,150}, {150,100,50}, {100,100,100} } for i = 1, #colors do local thisImage = Bitmap.new(Texture.new("ball.png")) thisImage:setColorTransform(colors[i][1], colors[i][2], colors[i][3],1) thisImage:setPosition(uiX, uiY) stage:addChild(thisImage) uiX = uiX + 50 print (thisImage:getColorTransform()) end |
Likes: moopf, cgsawtell, gokhansahin477, geisonbiazus, zvardin, roboward, Mastosch
Comments
why doesn't THIS work? It's nothing to do with loops... setting color transform with 3 specified channels that aren't 'all or nothing' values simply isn't showing a result:
I'd suggest experimenting with lower values.
Gideros does some things in odd ways! (Like, why are some colors expressed in hex and others in rgb, and why is rgb between 0 and 1?!)
Instead of using Sprite:setColorTransform(redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier)
you can use Sprite:setColorTransform(red / 255, green / 255, blue /255, alpha / 255)
if you're used to rgba
cheers
evs