Sprite Class Reference
| Inherits from | Node |
| Location | aphid.g2d.Sprite |
Overview
The Sprite class displays a rectangular area of a Texture2D on the screen.
Default Anchor of Sprite
Unlike the Node class, the default anchor is (0.5, 0.5), which is the center point of a sprite.
Overview of Constructors
-
Sprite(texture, [rect])Creates a sprite which displays a part of a texture on the screen.
-
Sprite()Creates a sprite without a texture. It can be used as a replacement of ColorNode.
Overview of Tasks
Attributes
- Type
-
color -
bool -
bool -
Point -
int -
Texture2D -
Rect
- Writability
-
readwrite -
readwrite -
readwrite -
readonly -
readwrite -
readwrite -
readwrite
Class Attributes
- Type
-
bool -
bool
- Writability
-
readwrite -
readwrite
Constructors
Sprite(texture, [rect])
Creates a sprite which displays a part of a texture on the screen.
Discussion
The contentSize of the sprite will be set to the value of rect.size.
Sprite()
Creates a sprite without a texture. It can be used as a replacement of ColorNode.
new Sprite()