Class TextEffect
java.lang.Object
me.emafire003.dev.particleanimationlib.Effect
me.emafire003.dev.particleanimationlib.effects.base.YPREffect
me.emafire003.dev.particleanimationlib.effects.TextEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTextEffectbuilder static inner class. -
Field Summary
FieldsModifier and TypeFieldDescriptionFont used to create the Textprotected BufferedImageContains an image version of the StringbooleanInvert the text, as in it makes it hollowed out of a rectangle backgroundbooleanSet this only to true if you are working with changing text.floatScale the font downintEach stepX pixel will be shown.intEach stepY pixel will be shown.Text to display.Fields inherited from class me.emafire003.dev.particleanimationlib.effects.base.YPREffect
pitch, pitchOffset, roll, rollOffset, shouldUpdateYPR, yaw, yawOffsetFields inherited from class me.emafire003.dev.particleanimationlib.Effect
delay, done, entityOrigin, executeOnStop, forced, iterations, limitParticlesEveryNIterations, originOffset, originPos, particle, particleLimit, shouldLimitParticlesEveryNIterations, shouldLimitParticlesSpawnedPerIteration, shouldSpawnParticlesEveryNIteration, spawnParticlesEveryNIteration, ticks, type, updatePositions, useEyePosAsOrigin, world -
Constructor Summary
ConstructorsConstructorDescriptionTextEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, String text, boolean invert, int stepX, int stepY, float size, boolean realtime, Font font) Creates a new TextEffect, displaying a given string with a given Font etc -
Method Summary
Modifier and TypeMethodDescriptionstatic TextEffect.Builderbuilder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos) Returns a builder for the effect.static voidcopy(TextEffect original, TextEffect copy) getFont()floatgetSize()intgetStepX()intgetStepY()getText()booleanisInvert()booleanvoidonRun()Main method to extend, here the animation code is run EACH tickvoidvoidsetInvert(boolean invert) voidsetRealtime(boolean realtime) voidsetSize(float size) voidsetStepX(int stepX) voidsetStepY(int stepY) voidMethods inherited from class me.emafire003.dev.particleanimationlib.effects.base.YPREffect
copy, getDirection, getPitch, getPitchOffset, getRoll, getRollOffset, getShouldUpdateYPR, getYaw, getYawOffset, setPitch, setPitchOffset, setRoll, setRollOffset, setShouldUpdateYPR, setYaw, setYawOffset, updatePosMethods inherited from class me.emafire003.dev.particleanimationlib.Effect
copy, displayParticle, displayParticle, displayParticle, getDelay, getEntityOrigin, getExecuteOnStop, getIterations, getLimitParticlesEveryNIterations, getOriginOffset, getOriginPos, getParticle, getParticleLimit, getSpawnParticlesEveryNIteration, getType, getWorld, getWorldRegistryKey, isForced, isUpdatePositions, isUseEyePosAsOrigin, onStop, run, run, runFor, runFor, setDelay, setEntityOrigin, setExecuteOnStop, setForced, setIterations, setLimitParticlesEveryNIterations, setOriginOffset, setOriginPos, setParticle, setParticleLimit, setShouldLimitParticlesEveryNIterations, setShouldLimitParticlesSpawnedPerIteration, setShouldSpawnParticlesEveryNIteration, setSpawnParticlesEveryNIteration, setUpdatePositions, setUseEyePosAsOrigin, setWorld, shouldLimitParticlesEveryNIterations, shouldLimitParticlesSpawnedPerIteration, shouldSpawnParticlesEveryNIteration
-
Field Details
-
text
Text to display. -
invert
public boolean invertInvert the text, as in it makes it hollowed out of a rectangle background -
stepX
public int stepXEach stepX pixel will be shown. Saves packets for lower fontsizes. -
stepY
public int stepYEach stepY pixel will be shown. Saves packets for lower fontsizes. -
size
public float sizeScale the font down -
realtime
public boolean realtimeSet this only to true if you are working with changing text. I'd advise the parser to recalculate the BufferedImage every iteration. Recommended FALSE -
font
Font used to create the Text -
image
Contains an image version of the String
-
-
Constructor Details
-
TextEffect
public TextEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, String text, boolean invert, int stepX, int stepY, float size, boolean realtime, Font font) Creates a new TextEffect, displaying a given string with a given Font etc- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesoriginPos- The origin position of the effect. Aka the center of the sphereyaw- The yaw of the effect. For example, you can get it from an Entity using getYaw()pitch- The pitch of the effect. For example, you can get it from an Entity using getPitch()text- A string of the text that will be displayedinvert- Set this true if you want the text to be "hollowed out" of a rectangle display, instead of only shown. Be careful! Way more particles are going to be used in this case!stepX- Each stepX pixel will be shown. Saves packets for lower fontsizes. UNRECOMMENDED: May very likely butcher the text if it's not set to 1stepY- Each stepX pixel will be shown. Saves packets for lower fontsizes. UNRECOMMENDED: May very likely butcher the text if it's not set to 1size- The size of the text to display. Play around with the font size itself too. Usually to get a good quality you would lower the size (this) to some fraction, and increase the font size to around 18realtime- Set this to True if you want to update the text that is displayedfont- The font that will be applied to the displayed Text
-
-
Method Details
-
copy
-
getText
-
setText
-
isInvert
public boolean isInvert() -
setInvert
public void setInvert(boolean invert) -
getStepX
public int getStepX() -
setStepX
public void setStepX(int stepX) -
getStepY
public int getStepY() -
setStepY
public void setStepY(int stepY) -
getSize
public float getSize() -
setSize
public void setSize(float size) -
isRealtime
public boolean isRealtime() -
setRealtime
public void setRealtime(boolean realtime) -
setFont
-
getFont
-
onRun
public void onRun()Description copied from class:EffectMain method to extend, here the animation code is run EACH tick -
builder
public static TextEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos) Returns a builder for the effect.- Parameters:
world- The world the particles are going to spawn inparticle- The particle effect that is going to be spawned. You can useParticleTypesoriginPos- The origin position of the effectSetting a world, a particle effect and an origin position is ALWAYS mandatory, hence their presence in this method! If this is an effect that uses Yaw and Pitch, remember to set those as well!
-