Skip to main content

Cocos Creator UI implementationAI reads Lanhu designs and follows your asset pipeline

AI reads Lanhu layout JSON and needed images, implements the interface in your Creator 2.x / 3.x TypeScript, node and prefab conventions, and handles Widget, Layout and Canvas adaptation.

Cocos Creator · TypeScript · Widget · Layout

Workflow preview

Lanhu design
MCP / Skill reads
AI writes the code
  1. 1
    Name design, version and entry
  2. 2
    AI reads design and conventions
  3. 3
    Implement along the pipeline
  4. 4
    Preview, compare, list the rest
Works with MCP or Skill

How does AI recreate dialogs and panels using my Creator conventions?

Creator UI work usually involves importing images, organizing nodes and prefabs, setting Widget and Layout, then writing event scripts. AI uses MCP or Skill to retrieve Lanhu layout JSON and images, reads your components and scripts, then writes matching interface logic and layout configuration. Asset import, prefab saving and previews use the available project tools.

Step 1

Your design and Creator project
A Lanhu design link, Creator version, design resolution, existing prefabs and asset directories, and target platforms.

Step 2

MCP / Skill reads the design
Original layout JSON available through Lanhu. When image downloads are enabled, supported images accessible to your account can be saved locally.

Step 3

AI implements in your project
AI implements nodes, components and events in the Creator project. Saving prefabs, importing SpriteFrames, building atlases and checking devices require project tools.

What AI does in your Creator project

AI reads Canvas adaptation, shared prefabs and component scripts, then uses Lanhu data to write layout, asset references and events. It follows the current Creator version’s APIs, naming and directories rather than hard-coding design coordinates into a separate structure.

Design enters the asset pipeline

Creator UI usually means imports, SpriteFrames, prefabs, scripts and adaptation. AI walks the chain in your project’s order.

Version and prefabs first

AI checks 2.x / 3.x, shared UI and TypeScript style before deciding what to reuse.

Scripts and layout your way

Data, events, Widget / Layout and Canvas adaptation land in the project’s code.

Proof it inside Creator

Check screen ratios, nine-slice, hit areas and dialog layering.

Fit panels, images and buttons into the existing prefab setup

On a narrow screen, scroll the table horizontally to compare all columns.

Fit panels, images and buttons into the existing prefab setup
Design cueAI follows project conventionsRun and compare
Canvas and device aspect ratiosUse the project’s design resolution and adaptation policyChange to target screen ratios and inspect cropping and margins
Edge buttons and repeated contentUse Widget for alignment and Layout for repeated regionsResize the parent and check positions and hit areas
Panel backgrounds and reward illustrationsImport required SpriteFrames and choose stretching or nine-slice by useResize panels and inspect corners and illustration proportions
Repeated dialogs and business actionsReuse prefabs and existing event conventionsOpen and close repeatedly to check references and callbacks

Have AI follow your prefabs and scripts

From a Lanhu link to a running interface: AI reads the design through MCP or Skill, writes code in your project, then runs and compares.

  1. 1

    Name design, version and entry

    Lanhu link, 2.x / 3.x, project directory and prefab locations.

  2. 2

    AI reads design and conventions

    Retrieves JSON and images, then reads shared components and scripts.

  3. 3

    Implement along the pipeline

    Reuse components for layout, state and events; asset work goes through editor tools.

  4. 4

    Preview, compare, list the rest

    Check Canvas, stretching, touch and dialogs; list remaining steps.

Before calling it complete: Canvas adaptation and local alignment · SpriteFrame and nine-slice borders · Touch, dialogs and prefab reuse

A reward dialog: connect design images to an existing prefab

For a reward dialog with shared buttons and a close flow, AI reads the panel, artwork and typography, inspects prefabs and scripts, then writes the reward list and button events. SpriteFrame references and layout configuration follow the project tools available.

  1. Image assets
    SpriteFrame

    Review import and slicing

  2. Nodes & components
    NodeSprite / Widget / Layout

    Organize prefab responsibilities

  3. Canvas adaptation
    Design resolutionTarget aspect ratio

    Check preview, then target devices

An example of the layout in a project. AI uses the Lanhu design data and existing project to choose components and arrange them.

Information in the Lanhu design

In the Lanhu design A dialog background, reward artwork and heading Confirm and close buttons

AI implements in your project

In the Creator project Import required images and set SpriteFrames Reuse buttons and dismissal, then adjust Widget and Layout Check the panel and hit areas at target ratios

Give this task to AI
Take responsibility for recreating this Lanhu UI in the current Cocos Creator project. Read layout JSON and needed images through MCP or Skill. Inspect the Creator version, shared UI, prefabs, TypeScript style and asset conventions. Implement UI, state and events using the project’s existing code and node-creation patterns, including Widget, Layout and Canvas adaptation, rather than creating a separate example. Use available editor tools for imports, SpriteFrames and prefab operations. When runnable, compare with the design, check stretching, touch, dialogs and screen ratios, then fix differences. Clearly list steps you cannot execute.

Review the AI implementation in Creator

With project tools, have AI check imports, scripts and previews, then adjust layout and image references against Lanhu. Editor assets and device operations depend on the host; distinguish unexecuted steps from completed code changes.

Open scenes and prefabs in the project’s version

Check import and script errors, then confirm new nodes follow naming and prefab conventions. APIs and resource formats differ between 2.x and 3.x. Without editor tools, review file changes separately from manual editor steps.

Change content and screen ratios

Use a longer title, add rewards and resize the parent, then run at target ratios to inspect Widget, Layout and anchors. Bottom actions should remain reachable and lists should scroll to the last item.

Trace images to SpriteFrames and interaction

Check image dimensions, formats, SpriteFrames, transparency, nine-slice borders and prefab references. For atlases, inspect the build output, then verify hit areas, dialog order and callbacks on target devices.

Connect to Lanhu with MCP or Skill

Choose the entry your AI tool supports. Configure your platform API Key locally and sign in to Lanhu. Give AI the design link and project directory, then ask it to read the design, inspect your code conventions and implement the UI. MCP and Skill provide the same design-reading capabilities.

AI needs access to your project to edit code and a working runtime to verify the result. MCP / Skill supplies design data, not a built-in engine converter. Enable image downloads locally when needed and follow your AI tool’s data settings.

Questions about Cocos implementation

How do scripts, prefabs and image imports divide the work?

With file access, AI writes scripts in the existing project. Prefabs, SpriteFrames, nine-slice setup and atlases need editor tools matching the Creator version. MCP or Skill supplies design data with no Creator editor control — AI separates executed steps from pending ones.

Can 2.x and 3.x share one implementation?

The design material is shared, but component APIs, asset formats and project conventions differ by version. State the version in the task and have AI read the existing project first.

Can Creator 2.x and 3.x both use Lanhu material?

Both can use the design material, but component APIs, resource formats and project code depend on the version. Specify it in the task and ask AI to inspect the existing project first.

Can a downloaded image be used immediately as a SpriteFrame?

It still needs Creator import and asset references. Have AI follow the project’s rules for SpriteFrames, transparency and stretching. Downloading does not configure engine assets.

Will the tool generate atlases or reduce package size automatically?

No. Atlases, compression and packaging belong to the Creator workflow and need configuration and checks for each target platform.

Experience Lanhu MCP Now

Create an account, get your API Key and choose MCP or the standalone Skill.

Your Lanhu login credentials stay on your device.