Options
All
  • Public
  • Public/Protected
  • All
Menu

A component describing a sprite as a sub-region of an image. Specifies the source Image2D atlas and the region to use.

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns Sprite2D

Properties

image

image: Entity

The Entity on which to look for a Image2D component to use as the source image. If null, the Image2D is looked for on the same entity as the Sprite2D.

imageRegion

imageRegion: Rect

The region of the source image to use as the sprite. The image is treated as a unit rectangle; thus this rectangle should use values in the range of 0..1. For example, to use the bottom left portion of the image, the rectangle should go from (0, 0) to (0.5, 0.5)

pivot

pivot: Vector2

The point in the sprite that is the sprite's center. Relative to the bottom-left corner of the sprite, in unit rectangle coordinates.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static image

image: EntityComponentFieldDesc

Static imageRegion

Static pivot

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

  • Parameters

    Returns Sprite2D

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc