public static final class TileAnimationData.Builder
extends java.lang.Object
TileAnimationData objects.
You can use this class to create frame animation data to be applied to a component on a tile.| 构造器 | 说明 |
|---|---|
Builder() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
TileAnimationData |
build() |
Builds a
TileAnimationData object. |
TileAnimationData.Builder |
setComponentId(int id) |
Sets the ID of the component to which this animation is to be applied.
|
TileAnimationData.Builder |
setOneShot(boolean isOneShot) |
Sets whether this animation is played only once.
|
TileAnimationData.Builder |
setResourceList(java.util.LinkedHashMap<java.lang.Integer,java.lang.Integer> resourceList) |
Sets the resource list for this frame animation.
|
public TileAnimationData.Builder setComponentId(int id)
id - Indicates the component ID to set.public TileAnimationData.Builder setResourceList(java.util.LinkedHashMap<java.lang.Integer,java.lang.Integer> resourceList)
Resources are added according to the playing sequence of the frame animation.
resourceList - Indicates the resource list represented by key-value pairs. key is the image
resource ID, and value is the duration of the animation frame.public TileAnimationData.Builder setOneShot(boolean isOneShot)
isOneShot - Specifies whether the animation is played only once. The value true indicates that
the animation is played only once, and false (default value) indicates that the animation is
played cyclically.public TileAnimationData build()
TileAnimationData object.
Before calling this method, you need to call setComponentId(int) and
setResourceList(java.util.LinkedHashMap) to make the animation valid.
TileAnimationData object.