2025-05-20 16:56:42 +07:00

3.0 KiB

sidebar_position, title, description
sidebar_position title description
18 Gamble Display Gamble

Gamble

Overview

Gamble in slot games is a feature that lets players risk their winnings for a chance to double (or multiply) them, usually by guessing a card color.

Device Type Preview
Desktop Desktop
Landscape Landscape
Portrait Portrait

Implementation

Prepare Assets

Scene Hierarchy

Place the node in the following scene structure:

Path Example
``` Canvas └── [main-view] └── [game-view] └── [gamble-loader] ``` ![Scene Structure](../img/05-main-scene/gamble/gamble-structure.png)
---

Setup

  • In node component include:

Scene Structure

Components

gamble-loader

  • A component for managing the loading and unloading of gambling scenes in a game.
Property Type Description
nodeBackground cc.Node Background node reference
sceneGamble String Name of the gamble scene
rootGambleName String Root node name for the gamble scene

gamble-panel-mobile-scaler

Backgrounds

Backgrounds

  1. Use background scenes for the gamble feature:
  1. Attach the orientation-ui-controller component to both gamble-background-landscape and gamble-background-portrait nodes.
  2. The gamble-background-portrait node has a dedicated component for portrait mode:
![gamble-background-portrait](../img/05-main-scene/gamble/gamble-portrait-component.png)

This component handles properties and logic specific to the portrait layout.

Game Result Example

Make sure the main scene includes the Win Limit Panel.
🔗 More Info Game Result