2025-05-22 14:09:43 +07:00

5.6 KiB
Raw Blame History

sidebar_position
sidebar_position
11

Mobile UI Panel

Overview

The Mobile UI provides a responsive interface for gameplay controls, adapting to both Landscape and Portrait orientations on mobile devices.

Orientation Preview
Landscape Mobile Landscape
Portrait Mobile Portrait

Implementation

Step 1: Set Up Prefabs

Configure the necessary prefabs for the Mobile UI.

Step Action Description Image Reference
1 Locate mobile-ui Prefab Search for the mobile-ui prefab in the project assets. Locate Prefabs
2 Clone Assets Copy the required assets to the game assets directory. Asset Placement
3 Paste Assets Paste into: assets/game-assets/prefabs/mobile. -
4 Locate buy-feature Prefab Search for the buy-feature prefab. Locate Prefabs
5 Paste Prefab Paste into: assets/game-assets/prefabs/mobile. -

Tip: Maintain the following directory structure for proper prefab references:

assets/
└── game-assets/
    └── prefabs/
        └── mobile/
            ├── mobile-ui.prefab
            └── buy-feature.prefab

Step 2: Rename Prefabs

Rename the copied prefabs by removing unnecessary prefixes to ensure consistency.

Prefix to Remove Example
template- Prefab Naming Example

Step 3: Configure UI in Main Scene

Add and configure a new node in the main scene to integrate the Mobile UI.

Main Scene Setup

Platform Node Spawner Settings:

Step 4: Apply Textures

Ensure all Mobile UI assets are prepared and applied correctly.

Texture Setup

Run the Helper Tool:

  • Use the Mobile UI helper tool to configure the UI components.

Step 5: Set Color Theme for Mobile UI

Customize the color theme for the Mobile UI using the helper-paint-color-ui-mobile.js component to apply theme-based colors across UI elements.

Follow Design:

Landscape Portrait
Landscape Menu Portrait Menu

Configuration Steps:

  1. Access the Helper Component:

    • Locate the helper-paint-color-ui-mobile.js component in the node inspector.
    • Color Setup
  2. Configure Color Properties:

    • Adjust the following properties to match the game design:
# Property Description Example
0 Paint Color Triggers repainting of UI components. Paint Color Trigger
1 Main UI Normal Color Default color for UI elements (e.g., Buy, Close, Auto). Main UI Examples
2 Main UI Highlight Color Color for highlighted or selected UI elements. Highlight Color
3 Toggle State Off Color Color for toggles in the off state. Toggle Off
4 Toggle State On Color Color for toggles in the on state. Toggle On
5 Background Info Page Color Background color for info pages. Info Page Background
6 Background Menu Color Background color for menus. Menu Background
7 Background Point Panel Color Background color for point/balance panels. Point Panel Background
8 Background Bottom Bar Color Background color for the bottom bar (Portrait only). Bottom Bar Background
9 Button Quit Color Color for the Quit button. Quit Button
10 Button Cancel Color Color for the Cancel button. Cancel Button
11 Label Balance Normal Color Color for the balance label in normal state. Balance Normal
12 Label Balance Spin Color Color for the balance label during spins. Balance Spin
13 Button Plus/Minus Auto Color Color for Plus/Minus buttons in autoplay. Plus/Minus Buttons
14 Label Start Auto Color Color for the Start Autoplay label. Start Auto Label
15 Label Outline Notification Outline color and width for notifications. Outline Notification
16 Total Win Medium Win Color Color for medium win labels. Medium Win Color

Tip: Ensure color values align with the games visual design specifications.