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
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
getter/setter pair
- 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.
getter/setter pair
- rotated → bool
-
The texture was rotated 90 degrees when being packed into a sprite sheet.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- 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
Methods
-
drawTexture(
Canvas canvas, Offset position, Paint paint) → void -
Draws the texture to a Canvas at a specified
position
and with the specifiedpaint
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
textureFromRect(
Rect rect, [String? name]) → SpriteTexture - Creates a new Texture from a part of the current texture.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited