Changing alpha of a sprite [SOLVED]

Is there a way to change the alpha of a sprite object using a script?

You can set the alpha channel of its “tint” color. (“tint” is a variable on the default sprite material).

-- Set the alpha to 0.5.
go.set("#sprite", "tint.w", 0.5) -- "tint" is a vector4 with x, y, z, w fields. 

-- Animate the alpha.
go.animate("#sprite", "tint.w", go.PLAYBACK_LOOP_PINGPONG, 0, go.EASING_INOUTSINE, 1)
6 Likes