Class TilePrefab
java.lang.Object
dev.prozilla.pine.core.entity.prefab.Prefab
dev.prozilla.pine.core.entity.prefab.sprite.SpritePrefab
dev.prozilla.pine.core.entity.prefab.sprite.TilePrefab
@Components({TileRenderer.class,SpriteRenderer.class,Transform.class})
public class TilePrefab
extends SpritePrefab
Prefab for 2D tiles.
-
Field Summary
FieldsFields inherited from class dev.prozilla.pine.core.entity.prefab.sprite.SpritePrefab
color, cropToRegion, regionOffset, regionSize, scale, texture -
Constructor Summary
ConstructorsConstructorDescriptionTilePrefab(TextureBase texture) TilePrefab(TextureBase texture, Vector2i coordinate) TilePrefab(String texturePath) TilePrefab(String texturePath, Vector2i coordinate) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds this prefab's predefined components to a given entity and copies values from this prefab.instantiate(World world, int x, int y) instantiate(World world, Vector2i coordinate) voidsetCoordinate(int x, int y) voidsetCoordinate(Vector2i coordinate) voidsetDimensions(Vector2i dimensions) Converts this tile prefab to a multi-tile prefab with the given dimensions.voidsetSize(int size) Methods inherited from class dev.prozilla.pine.core.entity.prefab.sprite.SpritePrefab
setColor, setRegion, setScaleMethods inherited from class dev.prozilla.pine.core.entity.prefab.Prefab
addChild, addChildren, addChildren, instantiate, instantiate, removeChild, setActive, setName, setTag
-
Field Details
-
coordinate
-
size
protected int size -
dimensions
-
-
Constructor Details
-
TilePrefab
-
TilePrefab
-
TilePrefab
-
TilePrefab
-
-
Method Details
-
setSize
public void setSize(int size) -
setCoordinate
public void setCoordinate(int x, int y) -
setCoordinate
-
setDimensions
Converts this tile prefab to a multi-tile prefab with the given dimensions.- Parameters:
dimensions- The dimensions of the multi-tile- See Also:
-
instantiate
-
instantiate
-
apply
Description copied from class:PrefabAdds this prefab's predefined components to a given entity and copies values from this prefab.- Overrides:
applyin classSpritePrefab
-