Class Prefab
java.lang.Object
dev.prozilla.pine.core.entity.prefab.Prefab
- Direct Known Subclasses:
CameraPrefab
,CanvasElementPrefab
,CanvasPrefab
,GridPrefab
,ParticleBurstEmitterPrefab
,SpritePrefab
Abstract class representing a prefab for creating entities with predefined components and values.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Adds this prefab's predefined components to a given entity and copies values from this prefab.instantiate
(World world) Creates a new entity instance with the prefab's default components at position (0, 0).instantiate
(World world, float x, float y) Creates a new entity instance with the prefab's default components.void
setActive
(boolean active) void
void
-
Field Details
-
name
-
tag
-
isActive
protected boolean isActive
-
-
Constructor Details
-
Prefab
public Prefab()
-
-
Method Details
-
setName
-
setTag
-
setActive
public void setActive(boolean active) -
instantiate
Creates a new entity instance with the prefab's default components at position (0, 0).- Parameters:
world
- The world where the entity will be added.- Returns:
- A new entity instance.
-
instantiate
Creates a new entity instance with the prefab's default components.- Parameters:
world
- The world where the entity will be added.x
- X positiony
- Y position- Returns:
- A new entity instance.
-
apply
Adds this prefab's predefined components to a given entity and copies values from this prefab.
-