Camera2D
Represents a 2D Camera in raylib.
Constructors
Link copied to clipboard
constructor(raw: ERROR CLASS: Symbol not found for raylib.internal.Camera2D)
constructor(offset: ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float> = 0F to 0F, target: ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float> = 0F to 0F, rotation: Float = 0.0f, zoom: Float = 1.0f)
Creates a new 2D Camera.
constructor(ox: Float = 0.0f, oy: Float = 0.0f, targetX: Float = 0.0f, targetY: Float = 0.0f, rotation: Float = 0.0f, zoom: Float = 1.0f)
Creates a new 2D Camera.
Properties
Functions
Link copied to clipboard
Updates the camera to follow the sprite's center position directly.
Link copied to clipboard
Updates the camera so that it only moves when the sprite approaches screen edges. Creates a "dead zone" in the center where camera doesn't move. Higher bbox values means the camera moves more often.
Link copied to clipboard
fun screenToWorld(position: ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
fun screenToWorld(x: Float, y: Float): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
fun screenToWorld(x: Int, y: Int): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
Converts screen coordinates to world coordinates based on the camera's transformation.
Link copied to clipboard
fun worldToScreen(position: ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
fun worldToScreen(x: Float, y: Float): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
fun worldToScreen(x: Int, y: Int): ERROR CLASS: Symbol not found for Pair<kotlin/Float, kotlin/Float>
Converts world coordinates to screen coordinates based on the camera's transformation.