Vector2
structVector2 : struct {
x, y : f32 = 0.0
} Bindings for raylib windowing, drawing, input, textures, fonts, 3D models, and audio.
14 structs · 69 functions · Public API
Vector2 : struct {
x, y : f32 = 0.0
} Vector3 : struct {
x, y, z : f32 = 0.0
} Vector4 : struct {
x, y, z, w : f32 = 0.0
} Matrix : struct {
m0, m4, m8, m12 : f32 = 0.0
m1, m5, m9, m13 : f32 = 0.0
m2, m6, m10, m14 : f32 = 0.0
m3, m7, m11, m15 : f32 = 0.0
} Image : struct {
data : ^void = null
width : i32 = 0
height : i32 = 0
mipmaps : i32 = 0
format : i32 = 0
} Texture : struct {
id : u32 = -1 // OpenGL texture id
width : i32 = 0 // Texture base width
height : i32 = 0 // Texture base height
mipmaps : i32 = 0 // Mipmap levels, 1 by default
format : i32 = 0 // Data format (PixelFormat type)
} Color : struct {
R : u8 = 255
G : u8 = 255
B : u8 = 255
A : u8 = 255
} Rectangle : struct {
x : f32 // Rectangle top-left corner position x
y : f32 // Rectangle top-left corner position y
width : f32 // Rectangle width
height : f32 // Rectangle height
} RenderTexture : struct {
id : u32 // OpenGL framebuffer object id
texture : Texture // Color buffer attachment texture
depth : Texture // Depth buffer attachment texture
} GlyphInfo : struct {
value : i32
offsetX : i32
offsetY : i32
advanceX : i32
image : Image
} Font : struct {
baseSize : i32
glyphCount : i32
glyphPadding : i32
texture : Texture2D
rects : ^Rectangle
glyphs : ^GlyphInfo
} Camera3D : struct {
position : Vector3
target : Vector3
up : Vector3
fovy : f32
projection : i32
} Camera2D : struct {
offset : Vector2
target : Vector2
rotation : f32
zoom : f32
} NPatchInfo : struct {
source : Rectangle // Texture source rectangle
left, // Left border offset
top, // Top border offset
right, // Right border offset
bottom, // Bottom border offset
layout : i64 // Layout type: NPatchLayout (3x3, 1x3, 3x1)
} InitWindow : func(width : i32, height : i32, title : cstring) -> void Windows Functions (Module: rcore)
CloseWindow : func () WindowShouldClose : func() -> bool IsWindowReady : func() -> bool IsWindowFullscreen : func() -> bool IsWindowHidden : func() -> bool IsWindowMinimized : func() -> bool IsWindowMaximized : func() -> bool IsWindowFocused : func() -> bool IsWindowResized : func() -> bool GetMonitorWidth : func(monitor : i32) -> i32 GetMonitorHeight : func(monitor : i32) -> i32 SetConfigFlags : func(flags : ConfigFlags ) SetWindowTitle : func(title : cstring) ClearBackground : func(color : Color) BeginDrawing : func() EndDrawing : func() BeginMode2D : func(camera : Camera2D) EndMode2D : func() BeginMode3D : func(camera : Camera3D) EndMode3D : func() DrawText : func(text : cstring, posX : i32, posY : i32, fontSize : i32, color : Color) DrawFPS : func(posX : i32, posY : i32 ) DrawRectangle : func(posX : i32, posY : i32, width : i32, height : i32, color : Color) BeginTextureMode : func(target : RenderTexture2D) EndTextureMode : func() IsKeyPressed : func(key : Keys ) -> bool IsKeyPressedRepeat : func(key : Keys) -> bool IsKeyDown : func(key : Keys ) -> bool IsKeyReleased : func(key : Keys) -> bool IsKeyUp : func (key : Keys) -> bool GetKeyPressed : func() -> i32 SetExitKey : func(key : Keys) SetTraceLogLevel : func(loglevel : TraceLevel) TraceLog : func(logLevel : TraceLevel, text : cstring) SetLoadFileDataCallback : func( cb : LoadFileDataCallback) -> void SetLoadFileTextCallback : func (cb : LoadFileTextCallback) -> void SetTargetFPS : func(fps : i32) GetFrameTime : func() -> f32 GetTime : func() -> f64 GetFPS : func() -> i32 ShowCursor : func() HideCursor : func() IsMouseButtonPressed : func (button : i32) -> bool IsMouseButtonDown : func(button : i32) -> bool IsMouseButtonReleased : func(button : i32) -> bool IsMouseButtonUp : func(button : i32) -> bool GetMouseX : func() -> i32 GetMouseY : func() -> i32 GetMousePosition : func() -> Vector2 GetMouseDelta : func() -> Vector2 SetMousePosition : func(x : i32, y: i32) SetMouseOffset : func(offsetX : i32, offsetY : i32) SetMouseScale : func(scaleX : float, scaleY : float) GetMouseWheelMove : func() -> float GetMouseWheelMoveV : func() -> Vector2 SetMouseCursor : func(cursor : i32) LoadImage : func(filename : cstring) -> Image UnloadImage : func(image : Image ) -> void LoadTexture : func(filename : cstring) -> Texture2D LoadTextureFromImage : func(image : Image) -> Texture2D LoadImageFromMemory : func(file_type : cstring, file_data : ^u8, data_size : i32 ) -> Image UnloadTexture : func(texture : Texture2D) DrawTexture : func(texture : Texture2D, posX : i32, posY : i32, tint : Color) DrawTextureV : func(texture : Texture2D, pos : Vector2, tint : Color) DrawTextureRec : func(texture : Texture2D, rect : Rectangle, position : Vector2, tint : Color) DrawTextureEx : func(texture : Texture2D, position : Vector2, rotation : float, scale : float, tint : Color) DrawTexturePro : func(texture : Texture2D, source : Rectangle, dest : Rectangle, origin : Vector2, rotation : float, tint : Color) DrawTextureNPatch : func(texture : Texture2D, patch_info : NPatchInfo, dest : Rectangle, origin : Vector2, rotation : float, tint : Color)