Package tripleplay.util
Class PackedFrames
java.lang.Object
tripleplay.util.PackedFrames
- All Implemented Interfaces:
Frames
A frames implementation that uses a packed texture atlas and metadata generated by the
FramePacker
.-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPackedFrames
(TileSource source, float[][] meta) PackedFrames
(TileSource source, float width, float height, PackedFrames.Frame[] frames) PackedFrames
(TileSource source, Json.Object meta) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(int index, ImageLayer layer) Configures the supplied image layer with the specified frame.pythagoras.f.Rectangle
bounds
(int index) Returns the bounds for the specified frame.int
count()
Returns the number of frames available.float
height()
Returns the height of a logical frame.pythagoras.f.Point
offset
(int index) Returns the offset (into the logical bounds) of the specified frame.float
width()
Returns the width of a logical frame.
-
Constructor Details
-
PackedFrames
-
PackedFrames
-
PackedFrames
-
-
Method Details
-
width
public float width()Description copied from interface:Frames
Returns the width of a logical frame. -
height
public float height()Description copied from interface:Frames
Returns the height of a logical frame. -
count
public int count()Description copied from interface:Frames
Returns the number of frames available. -
bounds
public pythagoras.f.Rectangle bounds(int index) Description copied from interface:Frames
Returns the bounds for the specified frame. -
offset
public pythagoras.f.Point offset(int index) Description copied from interface:Frames
Returns the offset (into the logical bounds) of the specified frame. -
apply
Description copied from interface:Frames
Configures the supplied image layer with the specified frame. The layer's image will be updated and the layer's translation will be adjusted to the requested frame's offset
-