Skip to main content

Scratch and Reveal

note

This template was developed using Effect House 3.0.0.

The Scratch and Reveal template implements custom textures and the Draw on Touch interaction, simulating a scratch-off ticket that reveals a question with a friend's profile information.

scratch and reveal demo

How to Use This Template

Open Effect House, go to Templates, click the Interactive tab, and select the Scratch and Reveal template.

scratch and reveal template

Hierarchy

In the Hierarchy panel, the 2D Foreground Effects render group is the primary render group. It contains all of the elements of the scratch ticket: the friend's Profile Photo and Username, the Ticket Background and Question, and the Graybox that obscures the question and profile information.

scratch and reveal hierarchy

Assets

The built-in material, social kit information, and textures are accessible in the Assets panel.

scratch and reveal assets

Open Material Editor to view the premade ScratchOff2DBrush_Mat material.

graybox material

Visual Scripting Breakdown

This template randomly selects a question and friend's profile information every time the effect is reset.

Double-click the ScratchAndRevealController subgraph to view the underlying logic. A question texture is randomly selected from the array in the subgraph's input.

The Draw on Touch interaction uses the graybox material and Clear Canvas control to simulate scratching the ticket to reveal the question and picture.

visual scripting breakdown

Customize the Questions

You can customize the type and number of questions in the ScratchAndRevealController subgraph. To add more questions, click the Add button [+] in the subgraph.

customize questions subgraph

To add a custom question, create a texture with your question using an image processing tool. Then import your texture by going to the Assets panel, clicking the Add button [+], going to Import, and clicking From Computer.

customize questions demo