ドキュメント

Unity Engine

Unity Engine

GenerateAtlas(Vector2[], int, int, List<Rect>)

Packs a set of rectangles into a square atlas, with optional padding between rectangles.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List<Rect> results)

Parameters

An array of rectangle dimensions.

padding

Amount of padding to insert between adjacent rectangles in the atlas.

atlasSize

The size of the atlas.

results

If the function succeeds, Unity populates this with the packed rectangles.

Returns

Type

Description

boolReturns
true
if the function succeeds. Otherwise, returns
false
.

Remarks

Additional Resources: Texture2D.PackTextures.