Skip to main content
Glama

cocos_enable_dynamic_atlas

Enable runtime dynamic atlas packing in Cocos Creator to batch small UI frames and runtime-generated sprites that AutoAtlas misses, reducing draw calls.

Instructions

Generate a boot script that enables Cocos 3.8's runtime dynamic atlas (dynamicAtlasManager.enabled = true).

Complements cocos_create_sprite_atlas — AutoAtlas packs at BUILD time, DynamicAtlas packs at RUN time. Turning both on catches small UI frames the AutoAtlas doesn't cover (e.g. runtime-generated text, sprite frames loaded lazily).

The generated .ts flips the global flag on onLoad; attach the resulting component to any persistent scene node (typically a GameManager). Typical flow::

r = cocos_enable_dynamic_atlas(project)
cocos_add_script(scene, gm_node_id, r["uuid_compressed"])

Parameters:

  • rel_path — defaults to DynamicAtlasBooter.ts under assets/scripts/.

  • max_frame_size — sprite frames larger than this (px) are NOT batched. Engine default 512.

  • class_name — TypeScript class name on the script.

Returns {path, rel_path, uuid_standard, uuid_compressed}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
rel_pathNoDynamicAtlasBooter.ts
max_frame_sizeNo
class_nameNoDynamicAtlasBooter
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It clearly describes the tool's behavior: generates a TypeScript file that sets a global flag on 'onLoad', needs to be attached to a persistent scene node, and returns specific data fields. However, it doesn't mention potential side effects, error conditions, or performance implications of enabling dynamic atlas.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with clear sections: purpose statement, technical context, usage guidance with example flow, parameter explanations, and return value documentation. Every sentence adds value with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no annotations and no output schema, the description provides excellent context about what the tool does, how to use it, parameter meanings, and return values. The only minor gap is not explicitly documenting the required 'project_path' parameter in the parameter list, though it's shown in the usage example.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining all 4 parameters: 'rel_path' (default location), 'max_frame_size' (sprite frame batching threshold with engine default), and 'class_name' (TypeScript class name). It also clarifies that 'project_path' is required by showing it in the typical flow example, though this could be more explicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate a boot script that enables Cocos 3.8's runtime dynamic atlas' with specific implementation details. It explicitly distinguishes from sibling tool 'cocos_create_sprite_atlas' by explaining the difference between AutoAtlas (build-time) and DynamicAtlas (runtime).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: it names the complementary tool ('cocos_create_sprite_atlas'), explains when to use both together ('catches small UI frames the AutoAtlas doesn't cover'), and provides a concrete usage example with the typical flow involving another sibling tool ('cocos_add_script').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenShengBiao/cocos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server