Class NodePrefab

java.lang.Object
dev.prozilla.pine.core.entity.prefab.Prefab
dev.prozilla.pine.core.entity.prefab.ui.NodePrefab
Direct Known Subclasses:
FramePrefab, ImagePrefab, LayoutPrefab, TextPrefab

@Components({Node.class,Transform.class}) public class NodePrefab extends Prefab
Prefab for UI elements.
  • Field Details

    • position

      protected DualDimension position
    • size

      protected DualDimension size
    • padding

      protected DualDimension padding
    • margin

      protected DualDimension margin
    • border

      protected Dimension border
    • borderImage

      protected TextureBase borderImage
    • borderImageSlice

      protected Vector4f borderImageSlice
    • borderImageSliceFill

      protected boolean borderImageSliceFill
    • color

      protected Color color
    • backgroundColor

      protected Color backgroundColor
    • anchor

      protected GridAlignment anchor
    • absolutePosition

      protected boolean absolutePosition
    • passThrough

      protected boolean passThrough
    • tooltipText

      protected String tooltipText
    • classes

      protected Set<String> classes
    • styleSheet

      protected StyleSheet styleSheet
  • Constructor Details

    • NodePrefab

      public NodePrefab()
  • Method Details

    • setStyleSheet

      public void setStyleSheet(String filePath)
      Sets the style sheet that is applied to this node by loading it from a CSS file.
    • setStyleSheet

      public void setStyleSheet(StyleSheet styleSheet)
      Sets the style sheet that is applied to this node.
    • setSize

      public void setSize(DimensionBase x, DimensionBase y)
      Sets the size of this node.
    • setSize

      public void setSize(DualDimension size)
      Sets the size of this node.
    • setSize

      public void setSize(VariableProperty<DualDimension> size)
      Sets the size of this node.
    • setPadding

      public void setPadding(DimensionBase x, DimensionBase y)
      Sets the padding around the content of this node.
    • setPadding

      public void setPadding(DualDimension padding)
      Sets the padding around the content of this node.
    • setPadding

      public void setPadding(VariableProperty<DualDimension> padding)
      Sets the padding around the content of this node.
    • setMargin

      public void setMargin(DimensionBase x, DimensionBase y)
    • setMargin

      public void setMargin(DualDimension margin)
    • setMargin

      public void setMargin(VariableProperty<DualDimension> margin)
    • setColor

      public void setColor(Color color)
      Sets the foreground color of this node.
    • setColor

      public void setColor(VariableProperty<Color> color)
      Sets the foreground color of this node.
    • setBackgroundColor

      public void setBackgroundColor(Color color)
      Sets the background color of this node.
    • setBackgroundColor

      public void setBackgroundColor(VariableProperty<Color> color)
      Sets the background color of this node.
    • setAnchor

      public void setAnchor(GridAlignment anchor)
      Sets the anchor point of this node.
    • setAbsolutePosition

      public void setAbsolutePosition(boolean absolutePosition)
      If absolutePosition is true, this node will not be affected by layout nodes.
    • setPassThrough

      public void setPassThrough(boolean passThrough)
      If passThrough is true, the cursor will not interact with this node.
    • setTooltipText

      public void setTooltipText(String tooltipText)
      Sets the text that appears in a tooltip when the cursor hovers over this node.
    • setBorder

      public void setBorder(Dimension border)
    • setBorderImage

      public void setBorderImage(TextureBase borderImage, Vector4f slice, boolean fill)
    • addClasses

      public void addClasses(String... classNames)
      Adds multiple classes to this node.
    • addClass

      public void addClass(String className)
      Adds a class to this node.
    • setDefaultPropertyValue

      protected <T> void setDefaultPropertyValue(StyledPropertyKey<T> propertyName, AdaptiveProperty<T> value)
    • apply

      protected void apply(Entity entity)
      Description copied from class: Prefab
      Adds this prefab's predefined components to a given entity and copies values from this prefab.
      Specified by:
      apply in class Prefab