Reverse Stencil (SOLVED)

I am busy developing some basic educational games and need some advice.

I need to create a game where a passage of text is hidden with a mask sliding across left to right, top to bottom and only the text inside the mask is visible.

In essence I want to create a stencil in reverse where the child node remains stationary and the box node slides (animates) across the top of the child node.

Any ideas?

I might be wrong but are you talking about this?

1 Like

There are two main approaches you could take:

  1. Use GUI stencils. Set up the stencil mask and make the text a child to it. This will make the child move along when you animate the mask so you need to compensate for that motion. Unfortunately there is no gui.get_world_position() that would make that easy though. (there’s an issue to add that to the gui API - DEF-566)

  2. The other approach is to create the masking yourself with custom rendering. Check out this thread for some leads: Making a "flashlight"

1 Like

Thank you. Got it going

1 Like