I am trying to learn more about Utils.modulate with the following exercise:
I am trying to make a layer called “replies” fully opaque when it’s on-screen at a certain y-position, and less opaque when it’s off-screen at another y-position.
To do so, I have “replies” inside a FlowComponent called “flow”
I then wrote the following:
replies.opacity = Utils.modulate(replies.y, [531, 162], [.6, 1.0])
Second, less elegant implementation question:
When I could not get Utils.modulate to work I set up the following two states:
This worked until I tried to tie “brighten” to scrolling up and “dim” to scrolling down. Any idea why this would not work?
if scroll.direction is "up"
if scroll.direction is "down"