Skip to content

Format

typescript
Atlas.GetTexture(uuid, out_rect)

class: Atlas

Description

Get the texture with the specified UUID from the atlas.

Parameters

param_nametypedescription
uuidstringThe UUID of the target texture.
out_rectRectThe position information of the target texture in the atlas.

Return

typedescription
Texture|nullReturns the specified texture. If the corresponding texture is not found in the atlas, null is returned.

Code Example

typescript
let atlas = Resources.Load<Atlas>(Atlas, "atlasId");
let rect = new Rect();
atlas.GetTexture("textureId", rect);