TypledSpriteAtlas class
A sprite atlas backed by a TypledAtlas.
Loads a Typled atlas definition and its associated image, applying edge-repeated padding to eliminate "ghost lines" caused by floating-point texture sampling errors.
Constructors
- TypledSpriteAtlas({required TypledAtlas atlas, required double tileSize, required Image image, required int padding})
-
Creates a TypledSpriteAtlas from a pre-loaded
atlasandimage.
Properties
- atlas → TypledAtlas
-
The parsed Typled atlas definition.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- image → Image
-
The atlas image (padded or original depending on configuration).
final
- padding → int
-
Padding added around each tile in the atlas (1px per side,
or 0 if padding is disabled).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tileSize → double
-
The tile size in pixels.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sprite(
String spriteId) → Sprite -
Returns a
Spritefor the givenspriteId. -
toBatch(
{bool useAtlas = false}) → SpriteBatch -
Creates a
SpriteBatchfrom this atlas image. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
load(
String path, {AssetsCache? cache, bool disablePadding = false}) → Future< TypledSpriteAtlas> -
Loads a TypledSpriteAtlas from the given asset
path.