Record Class PFCanvasRef

java.lang.Object
java.lang.Record
dev.pfaff.altargui.pathfinder.PFCanvasRef

public record PFCanvasRef(MemorySegment ptr) extends Record
  • Constructor Details

    • PFCanvasRef

      public PFCanvasRef(MemorySegment ptr)
      Creates an instance of a PFCanvasRef record class.
      Parameters:
      ptr - the value for the ptr record component
  • Method Details

    • takeScene

      public PFSceneRef takeScene()
    • setSize

      public void setSize(float width, float height)
    • setFont

      public void setFont(FKFontRef font)
      Parameters:
      font - the font to set. It is borrowed during the call, but is left usable afterwards.
    • setFontSize

      public void setFontSize(float size)
    • fillText

      public void fillText(String text, float x, float y)
    • strokeText

      public void strokeText(String text, float x, float y)
    • measureText

      public float measureText(String text)
      Returns:
      the width of the text
    • fillRect

      public void fillRect(float x1, float y1, float x2, float y2)
    • setFillStyle

      public void setFillStyle(PFFillStyleRef style)
    • setStrokeStyle

      public void setStrokeStyle(PFFillStyleRef style)
    • clear

      public void clear()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ptr

      public MemorySegment ptr()
      Returns the value of the ptr record component.
      Returns:
      the value of the ptr record component