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.


SpriteTexture(Image image)
Creates a new texture from an Image object. [...]


frame Rect
The frame of the trimmed texture inside the image. [...]
hashCode int
The hash code for this object. [...]
read-only, inherited
image Image
The image that this texture is a part of. [...]
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. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
size Size
The logical size of the texture, before being trimmed by the texture packer. [...]
spriteSourceSize Rect
The offset and size of the trimmed texture inside the image. [...]
trimmed bool
The texture was trimmed when being packed into a sprite sheet. [...]


drawTexture(Canvas canvas, Offset position, Paint paint) → void
Draws the texture to a Canvas at a specified position and with the specified paint.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
textureFromRect(Rect rect, [String name]) SpriteTexture
Creates a new Texture from a part of the current texture.
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]