← Yop2D

Questions about scenes, the HUD and game menus

Beginner guide · no code

Français · English · Español · Deutsch · Italiano · Português · Русский · 中文 · 日本語 · العربية

ℹ️ 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

The screens of your game (menus, levels, the end) and the interface elements: HUD, Replay and Quit buttons, lists, tabs, stars, gauges… The names in bold are the ones you see in Yop2D Next.

👉 A word you don't understand? See The words of Yop2D.

What is a HUD?

How do I make a “Replay” button?

How do I make a “Quit” button?

How do I react to the phone's back button?

  1. One scene per level: Level1, Level2, Level3. Create a game variable level_max that is 1 at the start (Create a variable).
  2. In the menu scene: Object → Interface elements → Scrolling list, named menu. Settings and style… → The choices (one per line): Level1, Level2, Level3 (the exact names of the scenes).
  3. Blueprint of the menu: On Start → Load variables from a file.
  4. When an interface element changes (Object menu) → If a variable… (Variable level_max, Comparison is greater than, Value =menu.progression) → True: Go to scene (by name) (Scene name =menu.texte). False: Show an alert window (“Not unlocked yet!”).
  5. At the end of level 1: If a variable… (level_max is less than 2) → True: Modify Variable (level_max, 2) → Save variables to a file. Same with 3 at the end of level 2.
👉 =menu.progression is the number of the line tapped (0 for the first), =menu.texte its text. See also Keep the score after closing the game.

How do I make end-of-level stars (★★★)?

  1. In the end scene: Object → Interface elements → Stars, named stars.
  2. Settings and style…: Number of stars 3, Stars lit at the start 0, and untick The player can tap the stars (to rate).
  3. Blueprint: On Start → Set Progress (Object stars, New progress =score / 10).
  4. Here, 10 points = 1 star, 30 points = 3 stars (never more than the number of stars). Change the 10 for your game.

How do I make a drop-down list (difficulty, language)?

How do I make tabs (Options / Sound / Controls)?

  1. Object → Interface elements → Tabs. Settings and style… → The choices (one per line): Options, Sound, Controls.
  2. Place one Panel per tab (same category), named p_options, p_sound, p_controls.
  3. Put your buttons and texts in their panel: in the object list of the left panel, long-press the object, then drag it onto the panel (it becomes its child).
  4. In the tabs' Settings and style… → The panel of each tab (one object name per line, in the same order): p_options, p_sound, p_controls.
  5. In the game, tapping a tab shows its panel and hides the others. No node to add.

How do I make a checkbox or a single choice?

How do I make a round gauge (cooldown)?

  1. Object → Interface elements → Round gauge, named cooldown. Settings and style…: Minimum value 0, Maximum value 100.
  2. Blueprint: Every frame → Add to Variable (Variable charge, Value to add 1) → Set Progress (Object cooldown, New progress =charge).
  3. When shooting: On Object Click (your button) → If a variable… (charge is at least 100) → True: shoot, then Modify Variable (charge, 0).
  4. The gauge never goes above its maximum value. For a faster cooldown, add 2 instead of 1.

How do I grey out a button (not available yet)?

How do I show a message window (alert)? And for Yes / No?

How do I make the phone vibrate?

How do I slow down time (slow motion)?

How do I change the game's start screen?

👉 To go from one screen to another: Change scenes, A transition between two scenes, Go to the next level, A settings screen, A slider and its value.