Class Text3D

java.lang.Object
net.risingworld.api.worldelements.GameObject
net.risingworld.api.worldelements.Text3D

public class Text3D extends GameObject
Represents a 3d world text
  • Constructor Details

    • Text3D

      public Text3D(String text)
    • Text3D

      public Text3D(String text, boolean billboard)
  • Method Details

    • setText

      public void setText(String text)
    • getText

      public String getText()
    • setFontColor

      public void setFontColor(float r, float g, float b, float a)
    • setFontColor

      public void setFontColor(int rgba)
    • setFontSize

      public void setFontSize(float size)
      Sets the font size. If set to 0, the game adjust the font size automatically depending on the text container size.
      Parameters:
      size - the new font size.
    • setTextWrappingMode

      public void setTextWrappingMode(Text3D.TextWrappingMode textWrap)
      Sets the text wrapping mode. By default it's set to NoWrap, so no automatic text wrapping occurs. Otherwise the game tries to fit the text to the size of the text container and wraps it if necessary. Irrespective of this setting, you can always manually insert a new line by adding the \n escape sequence.
      Parameters:
      textWrap - sets the text wrapping mode.
    • getTextWrappingMode

      public Text3D.TextWrappingMode getTextWrappingMode()
    • setTextContainer

      public void setTextContainer(float width, float height)
      Restricts the size of the actual text container. If set to 0 (default), the text container will be adjusted automatically, depending on the text size. The size of the text container is usually relevant if a text wrapping mode is set: If it's not set to NoWrap, the text will wrap automatically if it exceeds the width of the container.
      Parameters:
      width - the text container width (world space units).
      height - the text container height (world space units).
    • setBillboard

      public void setBillboard(boolean set)
      Enables or disables billboard handling for the text element. If true, this means that the text object will always face towards the player camera (in this case, the local rotation of the element will be ignored). Otherwise the element will always have a fixed rotation (controlled by the rotation property).
      Parameters:
      set - true to force the text to always face towards the player camera, false to have a fixed rotation.
    • setAlwaysVisible

      public void setAlwaysVisible(boolean set)
      Determines if the element should be always visible (i.e visible through walls etc) or not.
      Parameters:
      set - set to true to make this element always visible.