Class Camera2D

java.lang.Object
com.raylib.Camera2D

public class Camera2D extends Object
Camera2D, defines position/orientation in 2d space
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Camera2D

      public Camera2D()
      Construct with auto memory allocator and fields initialized to zero.
    • Camera2D

      public Camera2D(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Camera2D

      public Camera2D(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Camera2D

      public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      offset - Camera offset (displacement from target)
      target - Camera target (rotation and zoom origin)
      rotation - Camera rotation in degrees
      zoom - Camera zoom (scaling), should be 1.0f by default
    • Camera2D

      public Camera2D(SegmentAllocator arena, Vector2 offset, Vector2 target, float rotation, float zoom)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      offset - Camera offset (displacement from target)
      target - Camera target (rotation and zoom origin)
      rotation - Camera rotation in degrees
      zoom - Camera zoom (scaling), should be 1.0f by default
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Camera2D getArrayElement(int index)
    • allocateArray

      public static Camera2D allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Camera2D
    • allocateArray

      public static Camera2D allocateArray(long elementCount)
      Allocate an array of Camera2D
    • getOffset

      public Vector2 getOffset()
      Camera offset (displacement from target)
    • setOffset

      public void setOffset(Vector2 value)
      Camera offset (displacement from target)
    • offset

      public Vector2 offset()
      Camera offset (displacement from target)
    • offset

      public Camera2D offset(Vector2 value)
      Camera offset (displacement from target)
    • getTarget

      public Vector2 getTarget()
      Camera target (rotation and zoom origin)
    • setTarget

      public void setTarget(Vector2 value)
      Camera target (rotation and zoom origin)
    • target

      public Vector2 target()
      Camera target (rotation and zoom origin)
    • target

      public Camera2D target(Vector2 value)
      Camera target (rotation and zoom origin)
    • getRotation

      public float getRotation()
      Camera rotation in degrees
    • setRotation

      public void setRotation(float value)
      Camera rotation in degrees
    • rotation

      public float rotation()
      Camera rotation in degrees
    • rotation

      public Camera2D rotation(float value)
      Camera rotation in degrees
    • getZoom

      public float getZoom()
      Camera zoom (scaling), should be 1.0f by default
    • setZoom

      public void setZoom(float value)
      Camera zoom (scaling), should be 1.0f by default
    • zoom

      public float zoom()
      Camera zoom (scaling), should be 1.0f by default
    • zoom

      public Camera2D zoom(float value)
      Camera zoom (scaling), should be 1.0f by default