SpriteTexture class
A texture represents a rectangular area of an image and is typically used to draw a sprite to the screen.
Normally you get a reference to a texture from a SpriteSheet, but you can also create one from an Image.
Constructors
- SpriteTexture(Image image)
- Creates a new texture from an Image object. [...]
Properties
- frame → Rect
-
The frame of the trimmed texture inside the image. [...]
final
- image → Image
-
The image that this texture is a part of. [...]
final
- name ↔ String
-
The name of the image acts as a tag when acquiring a reference to it. [...]
read / write
- pivot ↔ Offset
-
The default pivot point for this texture. When creating a
Sprite
from the texture, this is the pivot point that will be used. [...]read / write - rotated → bool
-
The texture was rotated 90 degrees when being packed into a sprite sheet. [...]
final
- size → Size
-
The logical size of the texture, before being trimmed by the texture packer. [...]
final
- spriteSourceSize → Rect
-
The offset and size of the trimmed texture inside the image. [...]
final
- trimmed → bool
-
The texture was trimmed when being packed into a sprite sheet. [...]
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
drawTexture(
Canvas canvas, Offset position, Paint paint) → void -
Draws the texture to a Canvas at a specified
position
and with the specifiedpaint
. -
textureFromRect(
Rect rect, [ String name ]) → SpriteTexture - Creates a new Texture from a part of the current texture.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
other) → bool -
The equality operator. [...]
inherited