3.1 KiB
3.1 KiB
sidebar_position, title, description
sidebar_position | title | description |
---|---|---|
19 | Gamble | Display Gamble |
Gamble
Overview
The Gamble Feature allows players to risk their winnings for a chance to double or multiply them, typically by guessing a card’s color. It is supported across desktop and mobile platforms in both landscape and portrait orientations.
Device Type | Preview |
---|---|
Desktop | ![]() |
Landscape | ![]() |
Portrait | ![]() |
Implementation
Prepare Assets
Scene Hierarchy
Place the gamble node in the following scene structure:
Path | Example |
---|---|
``` Canvas └── [main-view] └── [game-view] └── [gamble-loader] ``` |  |
Setup
- In node component include:
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
- Use background scenes for the gamble feature:
-
gamble-background-landscape
: Setup Background Landscape -
gamble-background-portrait
: Setup Background Portrait
- Attach the
orientation-ui-controller
component to bothgamble-background-landscape
andgamble-background-portrait
nodes. - The
gamble-background-portrait
node has a dedicated component for portrait mode:

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