Class RegionInfluencer
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent
-
- com.badlogic.gdx.graphics.g3d.particles.influencers.Influencer
-
- com.badlogic.gdx.graphics.g3d.particles.influencers.RegionInfluencer
-
- All Implemented Interfaces:
ResourceData.Configurable
,Disposable
,Json.Serializable
- Direct Known Subclasses:
RegionInfluencer.Animated
,RegionInfluencer.Random
,RegionInfluencer.Single
public abstract class RegionInfluencer extends Influencer
It's anInfluencer
which assigns a region of aTexture
to the particles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RegionInfluencer.Animated
Assigns a region to the particles using the particle life percent to calculate the current index in theregions
array.static class
RegionInfluencer.AspectTextureRegion
It's a class used internally by theRegionInfluencer
to represent a texture region.static class
RegionInfluencer.Random
Assigns a random region ofregions
to the particles.static class
RegionInfluencer.Single
Assigns the first region ofregions
to the particles.
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
atlasName
Array<RegionInfluencer.AspectTextureRegion>
regions
-
Constructor Summary
Constructors Constructor Description RegionInfluencer()
RegionInfluencer(int regionsCount)
RegionInfluencer(TextureRegion... regions)
All the regions must be defined on the same TextureRegionInfluencer(RegionInfluencer regionInfluencer)
RegionInfluencer(Texture texture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TextureRegion... regions)
void
allocateChannels()
Called during initialization to allocate additional particles channelsvoid
clear()
void
load(AssetManager manager, ResourceData resources)
void
read(Json json, JsonValue jsonData)
void
save(AssetManager manager, ResourceData resources)
void
setAtlasName(java.lang.String atlasName)
void
write(Json json)
-
Methods inherited from class com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent
activateParticles, copy, dispose, end, init, killParticles, set, start, update
-
-
-
-
Field Detail
-
regions
public Array<RegionInfluencer.AspectTextureRegion> regions
-
atlasName
public java.lang.String atlasName
-
-
Constructor Detail
-
RegionInfluencer
public RegionInfluencer(int regionsCount)
-
RegionInfluencer
public RegionInfluencer()
-
RegionInfluencer
public RegionInfluencer(TextureRegion... regions)
All the regions must be defined on the same Texture
-
RegionInfluencer
public RegionInfluencer(Texture texture)
-
RegionInfluencer
public RegionInfluencer(RegionInfluencer regionInfluencer)
-
-
Method Detail
-
setAtlasName
public void setAtlasName(java.lang.String atlasName)
-
add
public void add(TextureRegion... regions)
-
clear
public void clear()
-
load
public void load(AssetManager manager, ResourceData resources)
- Specified by:
load
in interfaceResourceData.Configurable
- Overrides:
load
in classParticleControllerComponent
-
save
public void save(AssetManager manager, ResourceData resources)
- Specified by:
save
in interfaceResourceData.Configurable
- Overrides:
save
in classParticleControllerComponent
-
allocateChannels
public void allocateChannels()
Description copied from class:ParticleControllerComponent
Called during initialization to allocate additional particles channels- Overrides:
allocateChannels
in classParticleControllerComponent
-
write
public void write(Json json)
- Specified by:
write
in interfaceJson.Serializable
- Overrides:
write
in classParticleControllerComponent
-
read
public void read(Json json, JsonValue jsonData)
- Specified by:
read
in interfaceJson.Serializable
- Overrides:
read
in classParticleControllerComponent
-
-