Inherits from JavaScript Object
Location aphid.g2d.SpriteFrame

Overview

Represents content of a frame in an animation.

Overview of Constructors

Overview of Tasks

Attributes

  • Type
  • Rect
  • Rect
  • bool
  • Texture2D
  • Writability
  • readwrite
  • readwrite
  • readwrite
  • readwrite

Constructors

SpriteFrame(texture, [rectInPixels])

Create a frame from a portion of a texture.

new SpriteFrame(Texture2D texture, [Rect rectInPixels])

Parameters

Non-null Texture2D texture

A texture that will be used by a Sprite

Optional Non-null Rect rectInPixels

Defines the portion of texture to be used in a Sprite. texture.contentSize will be used if it’s not set

Attributes

rect

Portion of texture in points

Non-null readwrite Rect rect

rectInPixels

Portion of texture in pixels

Non-null readwrite Rect rectInPixels

rotated

readwrite bool rotated

Discussion

Set true to rotate the texture in the frame. Default is false

texture

Texture inside the frame.

Non-null readwrite Texture2D texture