ℹ️ For Yop2D Next, the new 2D + 3D version of Yop2D (coming soon). Button and node names are those of Yop2D Next.
🔍 How do I…? All short recipes, with a search
A slider the player drags (for example the volume), and a text that shows its value. Two objects, two nodes.
You need:
- a 2D project open in Yop2D Next.
Step 1: the slider
- Tap Object at the top of the editor, category Interface elements, then Slider.
- In the Inspector, type its name at the very top: volume.
- In the Inspector, tap the Settings and style… button: a window opens. Set Minimum value 0, Maximum value 100, Starting value 50, then close it.
Step 2: the text
- Tap Object → Texts → Text, and place it under the slider.
- Name it volume_label and type 50 in its Text line (the starting value).
Step 3: the nodes
- Open the Blueprint.
- Add When an interface element changes and choose the Object volume: it fires when the player lets go of the slider.
- Add Modify Text, Object volume_label, and type in New text:
=volume.progression. - Connect the two nodes.
The nodes
When an interface element changesvolume
→
Modify Textvolume_label · =volume.progression
Try it
Tap Play, drag the slider and let go: the text shows its value, a whole number between 0 and 100.
👉
=volume.progression means: the value of the volume object. It also works for a switch or a checkbox (0 or 1).👉 To see the text change while dragging, replace the event with Every frame.
👉 To keep the value in a variable (and use it elsewhere): the slider's Settings and style… button, Variable that receives the value (optional) line → New variable…