Class CanvasElementPrefab

java.lang.Object
dev.prozilla.pine.core.entity.prefab.Prefab
dev.prozilla.pine.core.entity.prefab.canvas.CanvasElementPrefab
Direct Known Subclasses:
ContainerPrefab, FramePrefab, ImagePrefab, RectPrefab, TextPrefab

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

  • Constructor Details

    • CanvasElementPrefab

      public CanvasElementPrefab()
  • Method Details

    • setPosition

      public void setPosition(DimensionBase x, DimensionBase y)
      Sets the position of this element on the canvas relative to its anchor point.
    • setPosition

      public void setPosition(DualDimension position)
      Sets the position of this element on the canvas relative to its anchor point.
    • setSize

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

      public void setSize(DualDimension size)
      Sets the size of this element on the canvas.
    • setAnchor

      public void setAnchor(GridAlignment anchor)
      Sets the anchor point on the canvas.
    • setAbsolutePosition

      public void setAbsolutePosition(boolean absolutePosition)
    • 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