Hi! I have this problem. I have a 20000 px layout-height platformer, and need a sprite in the layout to change it's color from RGB 23 24 25 to RGB 72 104 89 based on the sprites Y coordinates. Anyone got any idea how to best do this?
Figure there is a clever math solution I'm missing..
Thanks for any help!
Develop games in your browser. Powerful, performant & highly capable.
Here’s one way. Is one color at y=0 and the other at y=480.
t= sprite.y/480
Set color to rgb(lerp(23,72,t), lerp(24,104,t), lerp(25,89,t))
Thank you so much! That's great 👌