Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Make Sprite lighter — Gideros Forum

Make Sprite lighter

totebototebo Member
edited November 2015 in General questions
Having a mind blank. Is there a way to make a sprite lighter in Gideros?
My Gideros games: www.totebo.com

Comments

  • billydbbillydb Member
    Accepted Answer
    sprite:setColorTransform(?,?,?) ?
  • totebototebo Member
    edited November 2015
    Yeah, the mind blank was if there was an easy way to just make the sprite lighter. I think I was thinking about tinting, from the Flash days. This is how I solved it:
    local brightness = math.random(10)/10
    r = r/255 + lightness
    g = g/255 + lightness
    b = b/255 + lightness
    sprite:setColorTransform(r,g,b)
    My Gideros games: www.totebo.com
  • Cool, yeh I've used this a lot in my game for animating a day night cycle. I set the color on each corner of a mesh and you can get a nice gradient for a sunrise and sunset :)
  • Nice idea!
    My Gideros games: www.totebo.com
  • There is an alternative solution. Create sprites lighter! (in photoshop or ...) and setColorTeransform it for normal appearance.

    Likes: totebo

    +1 -1 (+1 / -0 )Share on Facebook
  • Tom2012Tom2012 Guru
    edited November 2015
    I use this in my game to make the character flash red:
    	self.flashingTween = GTween.new(self, .1, { redMultiplier=1.5, greenMultiplier=.01, blueMultiplier=.01 })
    Haven't tried altering the values to make them whiter but it should work. :)

    Ah, I see you solved it :)

    Likes: totebo

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.