@r1tsuu/raylib
Version:
Node.js bindings for raylib 5.5
2,654 lines (2,463 loc) • 396 kB
JavaScript
/**
* node-raylib
*
* @module raylib
* @file Definitions file for node-raylib.
*
* GENERATED CODE: DO NOT MODIFY
*/
const r = require('../../build/Release/node-raylib.node')
const raylib = {}
/**
* Initialize window and OpenGL context
*
* @param {number} width
* @param {number} height
* @param {string} title
*
* @return {undefined}
*/
function InitWindow(width, height, title) {
return r.BindInitWindow(
width,
height,
title
)
}
raylib.InitWindow = InitWindow
/**
* Close window and unload OpenGL context
*
* @return {undefined}
*/
function CloseWindow() {
return r.BindCloseWindow()
}
raylib.CloseWindow = CloseWindow
/**
* Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
*
* @return {boolean} The resulting bool.
*/
function WindowShouldClose() {
return r.BindWindowShouldClose()
}
raylib.WindowShouldClose = WindowShouldClose
/**
* Check if window has been initialized successfully
*
* @return {boolean} The resulting bool.
*/
function IsWindowReady() {
return r.BindIsWindowReady()
}
raylib.IsWindowReady = IsWindowReady
/**
* Check if window is currently fullscreen
*
* @return {boolean} The resulting bool.
*/
function IsWindowFullscreen() {
return r.BindIsWindowFullscreen()
}
raylib.IsWindowFullscreen = IsWindowFullscreen
/**
* Check if window is currently hidden
*
* @return {boolean} The resulting bool.
*/
function IsWindowHidden() {
return r.BindIsWindowHidden()
}
raylib.IsWindowHidden = IsWindowHidden
/**
* Check if window is currently minimized
*
* @return {boolean} The resulting bool.
*/
function IsWindowMinimized() {
return r.BindIsWindowMinimized()
}
raylib.IsWindowMinimized = IsWindowMinimized
/**
* Check if window is currently maximized
*
* @return {boolean} The resulting bool.
*/
function IsWindowMaximized() {
return r.BindIsWindowMaximized()
}
raylib.IsWindowMaximized = IsWindowMaximized
/**
* Check if window is currently focused
*
* @return {boolean} The resulting bool.
*/
function IsWindowFocused() {
return r.BindIsWindowFocused()
}
raylib.IsWindowFocused = IsWindowFocused
/**
* Check if window has been resized last frame
*
* @return {boolean} The resulting bool.
*/
function IsWindowResized() {
return r.BindIsWindowResized()
}
raylib.IsWindowResized = IsWindowResized
/**
* Check if one specific window flag is enabled
*
* @param {number} flag
*
* @return {boolean} The resulting bool.
*/
function IsWindowState(flag) {
return r.BindIsWindowState(
flag
)
}
raylib.IsWindowState = IsWindowState
/**
* Set window configuration state using flags
*
* @param {number} flags
*
* @return {undefined}
*/
function SetWindowState(flags) {
return r.BindSetWindowState(
flags
)
}
raylib.SetWindowState = SetWindowState
/**
* Clear window configuration state flags
*
* @param {number} flags
*
* @return {undefined}
*/
function ClearWindowState(flags) {
return r.BindClearWindowState(
flags
)
}
raylib.ClearWindowState = ClearWindowState
/**
* Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
*
* @return {undefined}
*/
function ToggleFullscreen() {
return r.BindToggleFullscreen()
}
raylib.ToggleFullscreen = ToggleFullscreen
/**
* Toggle window state: borderless windowed, resizes window to match monitor resolution
*
* @return {undefined}
*/
function ToggleBorderlessWindowed() {
return r.BindToggleBorderlessWindowed()
}
raylib.ToggleBorderlessWindowed = ToggleBorderlessWindowed
/**
* Set window state: maximized, if resizable
*
* @return {undefined}
*/
function MaximizeWindow() {
return r.BindMaximizeWindow()
}
raylib.MaximizeWindow = MaximizeWindow
/**
* Set window state: minimized, if resizable
*
* @return {undefined}
*/
function MinimizeWindow() {
return r.BindMinimizeWindow()
}
raylib.MinimizeWindow = MinimizeWindow
/**
* Set window state: not minimized/maximized
*
* @return {undefined}
*/
function RestoreWindow() {
return r.BindRestoreWindow()
}
raylib.RestoreWindow = RestoreWindow
/**
* Set icon for window (single image, RGBA 32bit)
*
* @param {Image} image
*
* @return {undefined}
*/
function SetWindowIcon(image) {
return r.BindSetWindowIcon(
image.data,
image.width,
image.height,
image.mipmaps,
image.format
)
}
raylib.SetWindowIcon = SetWindowIcon
/**
* Set icon for window (multiple images, RGBA 32bit)
*
* @param {number} images
* @param {number} count
*
* @return {undefined}
*/
function SetWindowIcons(images, count) {
return r.BindSetWindowIcons(
images,
count
)
}
raylib.SetWindowIcons = SetWindowIcons
/**
* Set title for window
*
* @param {string} title
*
* @return {undefined}
*/
function SetWindowTitle(title) {
return r.BindSetWindowTitle(
title
)
}
raylib.SetWindowTitle = SetWindowTitle
/**
* Set window position on screen
*
* @param {number} x
* @param {number} y
*
* @return {undefined}
*/
function SetWindowPosition(x, y) {
return r.BindSetWindowPosition(
x,
y
)
}
raylib.SetWindowPosition = SetWindowPosition
/**
* Set monitor for the current window
*
* @param {number} monitor
*
* @return {undefined}
*/
function SetWindowMonitor(monitor) {
return r.BindSetWindowMonitor(
monitor
)
}
raylib.SetWindowMonitor = SetWindowMonitor
/**
* Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
*
* @param {number} width
* @param {number} height
*
* @return {undefined}
*/
function SetWindowMinSize(width, height) {
return r.BindSetWindowMinSize(
width,
height
)
}
raylib.SetWindowMinSize = SetWindowMinSize
/**
* Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
*
* @param {number} width
* @param {number} height
*
* @return {undefined}
*/
function SetWindowMaxSize(width, height) {
return r.BindSetWindowMaxSize(
width,
height
)
}
raylib.SetWindowMaxSize = SetWindowMaxSize
/**
* Set window dimensions
*
* @param {number} width
* @param {number} height
*
* @return {undefined}
*/
function SetWindowSize(width, height) {
return r.BindSetWindowSize(
width,
height
)
}
raylib.SetWindowSize = SetWindowSize
/**
* Set window opacity [0.0f..1.0f]
*
* @param {number} opacity
*
* @return {undefined}
*/
function SetWindowOpacity(opacity) {
return r.BindSetWindowOpacity(
opacity
)
}
raylib.SetWindowOpacity = SetWindowOpacity
/**
* Set window focused
*
* @return {undefined}
*/
function SetWindowFocused() {
return r.BindSetWindowFocused()
}
raylib.SetWindowFocused = SetWindowFocused
/**
* Get native window handle
*
* @return {number} The resulting void *.
*/
function GetWindowHandle() {
return r.BindGetWindowHandle()
}
raylib.GetWindowHandle = GetWindowHandle
/**
* Get current screen width
*
* @return {number} The resulting int.
*/
function GetScreenWidth() {
return r.BindGetScreenWidth()
}
raylib.GetScreenWidth = GetScreenWidth
/**
* Get current screen height
*
* @return {number} The resulting int.
*/
function GetScreenHeight() {
return r.BindGetScreenHeight()
}
raylib.GetScreenHeight = GetScreenHeight
/**
* Get current render width (it considers HiDPI)
*
* @return {number} The resulting int.
*/
function GetRenderWidth() {
return r.BindGetRenderWidth()
}
raylib.GetRenderWidth = GetRenderWidth
/**
* Get current render height (it considers HiDPI)
*
* @return {number} The resulting int.
*/
function GetRenderHeight() {
return r.BindGetRenderHeight()
}
raylib.GetRenderHeight = GetRenderHeight
/**
* Get number of connected monitors
*
* @return {number} The resulting int.
*/
function GetMonitorCount() {
return r.BindGetMonitorCount()
}
raylib.GetMonitorCount = GetMonitorCount
/**
* Get current monitor where window is placed
*
* @return {number} The resulting int.
*/
function GetCurrentMonitor() {
return r.BindGetCurrentMonitor()
}
raylib.GetCurrentMonitor = GetCurrentMonitor
/**
* Get specified monitor position
*
* @param {number} monitor
*
* @return {Vector2} The resulting Vector2.
*/
function GetMonitorPosition(monitor) {
return r.BindGetMonitorPosition(
monitor
)
}
raylib.GetMonitorPosition = GetMonitorPosition
/**
* Get specified monitor width (current video mode used by monitor)
*
* @param {number} monitor
*
* @return {number} The resulting int.
*/
function GetMonitorWidth(monitor) {
return r.BindGetMonitorWidth(
monitor
)
}
raylib.GetMonitorWidth = GetMonitorWidth
/**
* Get specified monitor height (current video mode used by monitor)
*
* @param {number} monitor
*
* @return {number} The resulting int.
*/
function GetMonitorHeight(monitor) {
return r.BindGetMonitorHeight(
monitor
)
}
raylib.GetMonitorHeight = GetMonitorHeight
/**
* Get specified monitor physical width in millimetres
*
* @param {number} monitor
*
* @return {number} The resulting int.
*/
function GetMonitorPhysicalWidth(monitor) {
return r.BindGetMonitorPhysicalWidth(
monitor
)
}
raylib.GetMonitorPhysicalWidth = GetMonitorPhysicalWidth
/**
* Get specified monitor physical height in millimetres
*
* @param {number} monitor
*
* @return {number} The resulting int.
*/
function GetMonitorPhysicalHeight(monitor) {
return r.BindGetMonitorPhysicalHeight(
monitor
)
}
raylib.GetMonitorPhysicalHeight = GetMonitorPhysicalHeight
/**
* Get specified monitor refresh rate
*
* @param {number} monitor
*
* @return {number} The resulting int.
*/
function GetMonitorRefreshRate(monitor) {
return r.BindGetMonitorRefreshRate(
monitor
)
}
raylib.GetMonitorRefreshRate = GetMonitorRefreshRate
/**
* Get window position XY on monitor
*
* @return {Vector2} The resulting Vector2.
*/
function GetWindowPosition() {
return r.BindGetWindowPosition()
}
raylib.GetWindowPosition = GetWindowPosition
/**
* Get window scale DPI factor
*
* @return {Vector2} The resulting Vector2.
*/
function GetWindowScaleDPI() {
return r.BindGetWindowScaleDPI()
}
raylib.GetWindowScaleDPI = GetWindowScaleDPI
/**
* Get the human-readable, UTF-8 encoded name of the specified monitor
*
* @param {number} monitor
*
* @return {string} The resulting const char *.
*/
function GetMonitorName(monitor) {
return r.BindGetMonitorName(
monitor
)
}
raylib.GetMonitorName = GetMonitorName
/**
* Set clipboard text content
*
* @param {string} text
*
* @return {undefined}
*/
function SetClipboardText(text) {
return r.BindSetClipboardText(
text
)
}
raylib.SetClipboardText = SetClipboardText
/**
* Get clipboard text content
*
* @return {string} The resulting const char *.
*/
function GetClipboardText() {
return r.BindGetClipboardText()
}
raylib.GetClipboardText = GetClipboardText
/**
* Get clipboard image content
*
* @return {Image} The resulting Image.
*/
function GetClipboardImage() {
return r.BindGetClipboardImage()
}
raylib.GetClipboardImage = GetClipboardImage
/**
* Enable waiting for events on EndDrawing(), no automatic event polling
*
* @return {undefined}
*/
function EnableEventWaiting() {
return r.BindEnableEventWaiting()
}
raylib.EnableEventWaiting = EnableEventWaiting
/**
* Disable waiting for events on EndDrawing(), automatic events polling
*
* @return {undefined}
*/
function DisableEventWaiting() {
return r.BindDisableEventWaiting()
}
raylib.DisableEventWaiting = DisableEventWaiting
/**
* Shows cursor
*
* @return {undefined}
*/
function ShowCursor() {
return r.BindShowCursor()
}
raylib.ShowCursor = ShowCursor
/**
* Hides cursor
*
* @return {undefined}
*/
function HideCursor() {
return r.BindHideCursor()
}
raylib.HideCursor = HideCursor
/**
* Check if cursor is not visible
*
* @return {boolean} The resulting bool.
*/
function IsCursorHidden() {
return r.BindIsCursorHidden()
}
raylib.IsCursorHidden = IsCursorHidden
/**
* Enables cursor (unlock cursor)
*
* @return {undefined}
*/
function EnableCursor() {
return r.BindEnableCursor()
}
raylib.EnableCursor = EnableCursor
/**
* Disables cursor (lock cursor)
*
* @return {undefined}
*/
function DisableCursor() {
return r.BindDisableCursor()
}
raylib.DisableCursor = DisableCursor
/**
* Check if cursor is on the screen
*
* @return {boolean} The resulting bool.
*/
function IsCursorOnScreen() {
return r.BindIsCursorOnScreen()
}
raylib.IsCursorOnScreen = IsCursorOnScreen
/**
* Set background color (framebuffer clear color)
*
* @param {Color} color
*
* @return {undefined}
*/
function ClearBackground(color) {
return r.BindClearBackground(
color.r,
color.g,
color.b,
color.a
)
}
raylib.ClearBackground = ClearBackground
/**
* Setup canvas (framebuffer) to start drawing
*
* @return {undefined}
*/
function BeginDrawing() {
return r.BindBeginDrawing()
}
raylib.BeginDrawing = BeginDrawing
/**
* End canvas drawing and swap buffers (double buffering)
*
* @return {undefined}
*/
function EndDrawing() {
return r.BindEndDrawing()
}
raylib.EndDrawing = EndDrawing
/**
* Begin 2D mode with custom camera (2D)
*
* @param {Camera2D} camera
*
* @return {undefined}
*/
function BeginMode2D(camera) {
return r.BindBeginMode2D(
camera.offset.x,
camera.offset.y,
camera.target.x,
camera.target.y,
camera.rotation,
camera.zoom
)
}
raylib.BeginMode2D = BeginMode2D
/**
* Ends 2D mode with custom camera
*
* @return {undefined}
*/
function EndMode2D() {
return r.BindEndMode2D()
}
raylib.EndMode2D = EndMode2D
/**
* Begin 3D mode with custom camera (3D)
*
* @param {Camera3D} camera
*
* @return {undefined}
*/
function BeginMode3D(camera) {
return r.BindBeginMode3D(
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection
)
}
raylib.BeginMode3D = BeginMode3D
/**
* Ends 3D mode and returns to default 2D orthographic mode
*
* @return {undefined}
*/
function EndMode3D() {
return r.BindEndMode3D()
}
raylib.EndMode3D = EndMode3D
/**
* Begin drawing to render texture
*
* @param {RenderTexture} target
*
* @return {undefined}
*/
function BeginTextureMode(target) {
return r.BindBeginTextureMode(
target.id,
target.texture.id,
target.texture.width,
target.texture.height,
target.texture.mipmaps,
target.texture.format,
target.depth.id,
target.depth.width,
target.depth.height,
target.depth.mipmaps,
target.depth.format
)
}
raylib.BeginTextureMode = BeginTextureMode
/**
* Ends drawing to render texture
*
* @return {undefined}
*/
function EndTextureMode() {
return r.BindEndTextureMode()
}
raylib.EndTextureMode = EndTextureMode
/**
* Begin custom shader drawing
*
* @param {Shader} shader
*
* @return {undefined}
*/
function BeginShaderMode(shader) {
return r.BindBeginShaderMode(
shader.id,
shader.locs
)
}
raylib.BeginShaderMode = BeginShaderMode
/**
* End custom shader drawing (use default shader)
*
* @return {undefined}
*/
function EndShaderMode() {
return r.BindEndShaderMode()
}
raylib.EndShaderMode = EndShaderMode
/**
* Begin blending mode (alpha, additive, multiplied, subtract, custom)
*
* @param {number} mode
*
* @return {undefined}
*/
function BeginBlendMode(mode) {
return r.BindBeginBlendMode(
mode
)
}
raylib.BeginBlendMode = BeginBlendMode
/**
* End blending mode (reset to default: alpha blending)
*
* @return {undefined}
*/
function EndBlendMode() {
return r.BindEndBlendMode()
}
raylib.EndBlendMode = EndBlendMode
/**
* Begin scissor mode (define screen area for following drawing)
*
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
*
* @return {undefined}
*/
function BeginScissorMode(x, y, width, height) {
return r.BindBeginScissorMode(
x,
y,
width,
height
)
}
raylib.BeginScissorMode = BeginScissorMode
/**
* End scissor mode
*
* @return {undefined}
*/
function EndScissorMode() {
return r.BindEndScissorMode()
}
raylib.EndScissorMode = EndScissorMode
/**
* End stereo rendering (requires VR simulator)
*
* @return {undefined}
*/
function EndVrStereoMode() {
return r.BindEndVrStereoMode()
}
raylib.EndVrStereoMode = EndVrStereoMode
/**
* Load shader from files and bind default locations
*
* @param {string} vsFileName
* @param {string} fsFileName
*
* @return {Shader} The resulting Shader.
*/
function LoadShader(vsFileName, fsFileName) {
return r.BindLoadShader(
vsFileName,
fsFileName
)
}
raylib.LoadShader = LoadShader
/**
* Load shader from code strings and bind default locations
*
* @param {string} vsCode
* @param {string} fsCode
*
* @return {Shader} The resulting Shader.
*/
function LoadShaderFromMemory(vsCode, fsCode) {
return r.BindLoadShaderFromMemory(
vsCode,
fsCode
)
}
raylib.LoadShaderFromMemory = LoadShaderFromMemory
/**
* Check if a shader is valid (loaded on GPU)
*
* @param {Shader} shader
*
* @return {boolean} The resulting bool.
*/
function IsShaderValid(shader) {
return r.BindIsShaderValid(
shader.id,
shader.locs
)
}
raylib.IsShaderValid = IsShaderValid
/**
* Get shader uniform location
*
* @param {Shader} shader
* @param {string} uniformName
*
* @return {number} The resulting int.
*/
function GetShaderLocation(shader, uniformName) {
return r.BindGetShaderLocation(
shader.id,
shader.locs,
uniformName
)
}
raylib.GetShaderLocation = GetShaderLocation
/**
* Get shader attribute location
*
* @param {Shader} shader
* @param {string} attribName
*
* @return {number} The resulting int.
*/
function GetShaderLocationAttrib(shader, attribName) {
return r.BindGetShaderLocationAttrib(
shader.id,
shader.locs,
attribName
)
}
raylib.GetShaderLocationAttrib = GetShaderLocationAttrib
/**
* Set shader uniform value (matrix 4x4)
*
* @param {Shader} shader
* @param {number} locIndex
* @param {Matrix} mat
*
* @return {undefined}
*/
function SetShaderValueMatrix(shader, locIndex, mat) {
return r.BindSetShaderValueMatrix(
shader.id,
shader.locs,
locIndex,
mat.m0,
mat.m4,
mat.m8,
mat.m12,
mat.m1,
mat.m5,
mat.m9,
mat.m13,
mat.m2,
mat.m6,
mat.m10,
mat.m14,
mat.m3,
mat.m7,
mat.m11,
mat.m15
)
}
raylib.SetShaderValueMatrix = SetShaderValueMatrix
/**
* Set shader uniform value for texture (sampler2d)
*
* @param {Shader} shader
* @param {number} locIndex
* @param {Texture} texture
*
* @return {undefined}
*/
function SetShaderValueTexture(shader, locIndex, texture) {
return r.BindSetShaderValueTexture(
shader.id,
shader.locs,
locIndex,
texture.id,
texture.width,
texture.height,
texture.mipmaps,
texture.format
)
}
raylib.SetShaderValueTexture = SetShaderValueTexture
/**
* Unload shader from GPU memory (VRAM)
*
* @param {Shader} shader
*
* @return {undefined}
*/
function UnloadShader(shader) {
return r.BindUnloadShader(
shader.id,
shader.locs
)
}
raylib.UnloadShader = UnloadShader
/**
* Get a ray trace from screen position (i.e mouse)
*
* @param {Vector2} position
* @param {Camera3D} camera
*
* @return {Ray} The resulting Ray.
*/
function GetScreenToWorldRay(position, camera) {
return r.BindGetScreenToWorldRay(
position.x,
position.y,
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection
)
}
raylib.GetScreenToWorldRay = GetScreenToWorldRay
/**
* Get a ray trace from screen position (i.e mouse) in a viewport
*
* @param {Vector2} position
* @param {Camera3D} camera
* @param {number} width
* @param {number} height
*
* @return {Ray} The resulting Ray.
*/
function GetScreenToWorldRayEx(position, camera, width, height) {
return r.BindGetScreenToWorldRayEx(
position.x,
position.y,
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection,
width,
height
)
}
raylib.GetScreenToWorldRayEx = GetScreenToWorldRayEx
/**
* Get the screen space position for a 3d world space position
*
* @param {Vector3} position
* @param {Camera3D} camera
*
* @return {Vector2} The resulting Vector2.
*/
function GetWorldToScreen(position, camera) {
return r.BindGetWorldToScreen(
position.x,
position.y,
position.z,
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection
)
}
raylib.GetWorldToScreen = GetWorldToScreen
/**
* Get size position for a 3d world space position
*
* @param {Vector3} position
* @param {Camera3D} camera
* @param {number} width
* @param {number} height
*
* @return {Vector2} The resulting Vector2.
*/
function GetWorldToScreenEx(position, camera, width, height) {
return r.BindGetWorldToScreenEx(
position.x,
position.y,
position.z,
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection,
width,
height
)
}
raylib.GetWorldToScreenEx = GetWorldToScreenEx
/**
* Get the screen space position for a 2d camera world space position
*
* @param {Vector2} position
* @param {Camera2D} camera
*
* @return {Vector2} The resulting Vector2.
*/
function GetWorldToScreen2D(position, camera) {
return r.BindGetWorldToScreen2D(
position.x,
position.y,
camera.offset.x,
camera.offset.y,
camera.target.x,
camera.target.y,
camera.rotation,
camera.zoom
)
}
raylib.GetWorldToScreen2D = GetWorldToScreen2D
/**
* Get the world space position for a 2d camera screen space position
*
* @param {Vector2} position
* @param {Camera2D} camera
*
* @return {Vector2} The resulting Vector2.
*/
function GetScreenToWorld2D(position, camera) {
return r.BindGetScreenToWorld2D(
position.x,
position.y,
camera.offset.x,
camera.offset.y,
camera.target.x,
camera.target.y,
camera.rotation,
camera.zoom
)
}
raylib.GetScreenToWorld2D = GetScreenToWorld2D
/**
* Get camera transform matrix (view matrix)
*
* @param {Camera3D} camera
*
* @return {Matrix} The resulting Matrix.
*/
function GetCameraMatrix(camera) {
return r.BindGetCameraMatrix(
camera.position.x,
camera.position.y,
camera.position.z,
camera.target.x,
camera.target.y,
camera.target.z,
camera.up.x,
camera.up.y,
camera.up.z,
camera.fovy,
camera.projection
)
}
raylib.GetCameraMatrix = GetCameraMatrix
/**
* Get camera 2d transform matrix
*
* @param {Camera2D} camera
*
* @return {Matrix} The resulting Matrix.
*/
function GetCameraMatrix2D(camera) {
return r.BindGetCameraMatrix2D(
camera.offset.x,
camera.offset.y,
camera.target.x,
camera.target.y,
camera.rotation,
camera.zoom
)
}
raylib.GetCameraMatrix2D = GetCameraMatrix2D
/**
* Set target FPS (maximum)
*
* @param {number} fps
*
* @return {undefined}
*/
function SetTargetFPS(fps) {
return r.BindSetTargetFPS(
fps
)
}
raylib.SetTargetFPS = SetTargetFPS
/**
* Get time in seconds for last frame drawn (delta time)
*
* @return {number} The resulting float.
*/
function GetFrameTime() {
return r.BindGetFrameTime()
}
raylib.GetFrameTime = GetFrameTime
/**
* Get elapsed time in seconds since InitWindow()
*
* @return {number} The resulting double.
*/
function GetTime() {
return r.BindGetTime()
}
raylib.GetTime = GetTime
/**
* Get current FPS
*
* @return {number} The resulting int.
*/
function GetFPS() {
return r.BindGetFPS()
}
raylib.GetFPS = GetFPS
/**
* Swap back buffer with front buffer (screen drawing)
*
* @return {undefined}
*/
function SwapScreenBuffer() {
return r.BindSwapScreenBuffer()
}
raylib.SwapScreenBuffer = SwapScreenBuffer
/**
* Register all input events
*
* @return {undefined}
*/
function PollInputEvents() {
return r.BindPollInputEvents()
}
raylib.PollInputEvents = PollInputEvents
/**
* Wait for some time (halt program execution)
*
* @param {number} seconds
*
* @return {undefined}
*/
function WaitTime(seconds) {
return r.BindWaitTime(
seconds
)
}
raylib.WaitTime = WaitTime
/**
* Set the seed for the random number generator
*
* @param {number} seed
*
* @return {undefined}
*/
function SetRandomSeed(seed) {
return r.BindSetRandomSeed(
seed
)
}
raylib.SetRandomSeed = SetRandomSeed
/**
* Get a random value between min and max (both included)
*
* @param {number} min
* @param {number} max
*
* @return {number} The resulting int.
*/
function GetRandomValue(min, max) {
return r.BindGetRandomValue(
min,
max
)
}
raylib.GetRandomValue = GetRandomValue
/**
* Load random values sequence, no values repeated
*
* @param {number} count
* @param {number} min
* @param {number} max
*
* @return {number} The resulting int *.
*/
function LoadRandomSequence(count, min, max) {
return r.BindLoadRandomSequence(
count,
min,
max
)
}
raylib.LoadRandomSequence = LoadRandomSequence
/**
* Unload random values sequence
*
* @param {number} sequence
*
* @return {undefined}
*/
function UnloadRandomSequence(sequence) {
return r.BindUnloadRandomSequence(
sequence
)
}
raylib.UnloadRandomSequence = UnloadRandomSequence
/**
* Takes a screenshot of current screen (filename extension defines format)
*
* @param {string} fileName
*
* @return {undefined}
*/
function TakeScreenshot(fileName) {
return r.BindTakeScreenshot(
fileName
)
}
raylib.TakeScreenshot = TakeScreenshot
/**
* Setup init configuration flags (view FLAGS)
*
* @param {number} flags
*
* @return {undefined}
*/
function SetConfigFlags(flags) {
return r.BindSetConfigFlags(
flags
)
}
raylib.SetConfigFlags = SetConfigFlags
/**
* Open URL with default system browser (if available)
*
* @param {string} url
*
* @return {undefined}
*/
function OpenURL(url) {
return r.BindOpenURL(
url
)
}
raylib.OpenURL = OpenURL
/**
* Set the current threshold (minimum) log level
*
* @param {number} logLevel
*
* @return {undefined}
*/
function SetTraceLogLevel(logLevel) {
return r.BindSetTraceLogLevel(
logLevel
)
}
raylib.SetTraceLogLevel = SetTraceLogLevel
/**
* Internal memory allocator
*
* @param {number} size
*
* @return {number} The resulting void *.
*/
function MemAlloc(size) {
return r.BindMemAlloc(
size
)
}
raylib.MemAlloc = MemAlloc
/**
* Internal memory reallocator
*
* @param {number} ptr
* @param {number} size
*
* @return {number} The resulting void *.
*/
function MemRealloc(ptr, size) {
return r.BindMemRealloc(
ptr,
size
)
}
raylib.MemRealloc = MemRealloc
/**
* Internal memory free
*
* @param {number} ptr
*
* @return {undefined}
*/
function MemFree(ptr) {
return r.BindMemFree(
ptr
)
}
raylib.MemFree = MemFree
/**
* Load file data as byte array (read)
*
* @param {string} fileName
* @param {number} dataSize
*
* @return {Buffer} The resulting unsigned char *.
*/
function LoadFileData(fileName, dataSize) {
return r.BindLoadFileData(
fileName,
dataSize
)
}
raylib.LoadFileData = LoadFileData
/**
* Unload file data allocated by LoadFileData()
*
* @param {Buffer} data
*
* @return {undefined}
*/
function UnloadFileData(data) {
return r.BindUnloadFileData(
data
)
}
raylib.UnloadFileData = UnloadFileData
/**
* Save data to file from byte array (write), returns true on success
*
* @param {string} fileName
* @param {number} data
* @param {number} dataSize
*
* @return {boolean} The resulting bool.
*/
function SaveFileData(fileName, data, dataSize) {
return r.BindSaveFileData(
fileName,
data,
dataSize
)
}
raylib.SaveFileData = SaveFileData
/**
* Export data to code (.h), returns true on success
*
* @param {Buffer} data
* @param {number} dataSize
* @param {string} fileName
*
* @return {boolean} The resulting bool.
*/
function ExportDataAsCode(data, dataSize, fileName) {
return r.BindExportDataAsCode(
data,
dataSize,
fileName
)
}
raylib.ExportDataAsCode = ExportDataAsCode
/**
* Load text data from file (read), returns a '\0' terminated string
*
* @param {string} fileName
*
* @return {string} The resulting char *.
*/
function LoadFileText(fileName) {
return r.BindLoadFileText(
fileName
)
}
raylib.LoadFileText = LoadFileText
/**
* Unload file text data allocated by LoadFileText()
*
* @param {string} text
*
* @return {undefined}
*/
function UnloadFileText(text) {
return r.BindUnloadFileText(
text
)
}
raylib.UnloadFileText = UnloadFileText
/**
* Save text data to file (write), string must be '\0' terminated, returns true on success
*
* @param {string} fileName
* @param {string} text
*
* @return {boolean} The resulting bool.
*/
function SaveFileText(fileName, text) {
return r.BindSaveFileText(
fileName,
text
)
}
raylib.SaveFileText = SaveFileText
/**
* Check if file exists
*
* @param {string} fileName
*
* @return {boolean} The resulting bool.
*/
function FileExists(fileName) {
return r.BindFileExists(
fileName
)
}
raylib.FileExists = FileExists
/**
* Check if a directory path exists
*
* @param {string} dirPath
*
* @return {boolean} The resulting bool.
*/
function DirectoryExists(dirPath) {
return r.BindDirectoryExists(
dirPath
)
}
raylib.DirectoryExists = DirectoryExists
/**
* Check file extension (including point: .png, .wav)
*
* @param {string} fileName
* @param {string} ext
*
* @return {boolean} The resulting bool.
*/
function IsFileExtension(fileName, ext) {
return r.BindIsFileExtension(
fileName,
ext
)
}
raylib.IsFileExtension = IsFileExtension
/**
* Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
*
* @param {string} fileName
*
* @return {number} The resulting int.
*/
function GetFileLength(fileName) {
return r.BindGetFileLength(
fileName
)
}
raylib.GetFileLength = GetFileLength
/**
* Get pointer to extension for a filename string (includes dot: '.png')
*
* @param {string} fileName
*
* @return {string} The resulting const char *.
*/
function GetFileExtension(fileName) {
return r.BindGetFileExtension(
fileName
)
}
raylib.GetFileExtension = GetFileExtension
/**
* Get pointer to filename for a path string
*
* @param {string} filePath
*
* @return {string} The resulting const char *.
*/
function GetFileName(filePath) {
return r.BindGetFileName(
filePath
)
}
raylib.GetFileName = GetFileName
/**
* Get filename string without extension (uses static string)
*
* @param {string} filePath
*
* @return {string} The resulting const char *.
*/
function GetFileNameWithoutExt(filePath) {
return r.BindGetFileNameWithoutExt(
filePath
)
}
raylib.GetFileNameWithoutExt = GetFileNameWithoutExt
/**
* Get full path for a given fileName with path (uses static string)
*
* @param {string} filePath
*
* @return {string} The resulting const char *.
*/
function GetDirectoryPath(filePath) {
return r.BindGetDirectoryPath(
filePath
)
}
raylib.GetDirectoryPath = GetDirectoryPath
/**
* Get previous directory path for a given path (uses static string)
*
* @param {string} dirPath
*
* @return {string} The resulting const char *.
*/
function GetPrevDirectoryPath(dirPath) {
return r.BindGetPrevDirectoryPath(
dirPath
)
}
raylib.GetPrevDirectoryPath = GetPrevDirectoryPath
/**
* Get current working directory (uses static string)
*
* @return {string} The resulting const char *.
*/
function GetWorkingDirectory() {
return r.BindGetWorkingDirectory()
}
raylib.GetWorkingDirectory = GetWorkingDirectory
/**
* Get the directory of the running application (uses static string)
*
* @return {string} The resulting const char *.
*/
function GetApplicationDirectory() {
return r.BindGetApplicationDirectory()
}
raylib.GetApplicationDirectory = GetApplicationDirectory
/**
* Create directories (including full path requested), returns 0 on success
*
* @param {string} dirPath
*
* @return {number} The resulting int.
*/
function MakeDirectory(dirPath) {
return r.BindMakeDirectory(
dirPath
)
}
raylib.MakeDirectory = MakeDirectory
/**
* Change working directory, return true on success
*
* @param {string} dir
*
* @return {boolean} The resulting bool.
*/
function ChangeDirectory(dir) {
return r.BindChangeDirectory(
dir
)
}
raylib.ChangeDirectory = ChangeDirectory
/**
* Check if a given path is a file or a directory
*
* @param {string} path
*
* @return {boolean} The resulting bool.
*/
function IsPathFile(path) {
return r.BindIsPathFile(
path
)
}
raylib.IsPathFile = IsPathFile
/**
* Check if fileName is valid for the platform/OS
*
* @param {string} fileName
*
* @return {boolean} The resulting bool.
*/
function IsFileNameValid(fileName) {
return r.BindIsFileNameValid(
fileName
)
}
raylib.IsFileNameValid = IsFileNameValid
/**
* Load directory filepaths
*
* @param {string} dirPath
*
* @return {FilePathList} The resulting FilePathList.
*/
function LoadDirectoryFiles(dirPath) {
return r.BindLoadDirectoryFiles(
dirPath
)
}
raylib.LoadDirectoryFiles = LoadDirectoryFiles
/**
* Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
*
* @param {string} basePath
* @param {string} filter
* @param {boolean} scanSubdirs
*
* @return {FilePathList} The resulting FilePathList.
*/
function LoadDirectoryFilesEx(basePath, filter, scanSubdirs) {
return r.BindLoadDirectoryFilesEx(
basePath,
filter,
scanSubdirs
)
}
raylib.LoadDirectoryFilesEx = LoadDirectoryFilesEx
/**
* Unload filepaths
*
* @param {FilePathList} files
*
* @return {undefined}
*/
function UnloadDirectoryFiles(files) {
return r.BindUnloadDirectoryFiles(
files.capacity,
files.count,
files.paths
)
}
raylib.UnloadDirectoryFiles = UnloadDirectoryFiles
/**
* Check if a file has been dropped into window
*
* @return {boolean} The resulting bool.
*/
function IsFileDropped() {
return r.BindIsFileDropped()
}
raylib.IsFileDropped = IsFileDropped
/**
* Load dropped filepaths
*
* @return {FilePathList} The resulting FilePathList.
*/
function LoadDroppedFiles() {
return r.BindLoadDroppedFiles()
}
raylib.LoadDroppedFiles = LoadDroppedFiles
/**
* Unload dropped filepaths
*
* @param {FilePathList} files
*
* @return {undefined}
*/
function UnloadDroppedFiles(files) {
return r.BindUnloadDroppedFiles(
files.capacity,
files.count,
files.paths
)
}
raylib.UnloadDroppedFiles = UnloadDroppedFiles
/**
* Get file modification time (last write time)
*
* @param {string} fileName
*
* @return {number} The resulting long.
*/
function GetFileModTime(fileName) {
return r.BindGetFileModTime(
fileName
)
}
raylib.GetFileModTime = GetFileModTime
/**
* Compress data (DEFLATE algorithm), memory must be MemFree()
*
* @param {Buffer} data
* @param {number} dataSize
* @param {number} compDataSize
*
* @return {Buffer} The resulting unsigned char *.
*/
function CompressData(data, dataSize, compDataSize) {
return r.BindCompressData(
data,
dataSize,
compDataSize
)
}
raylib.CompressData = CompressData
/**
* Decompress data (DEFLATE algorithm), memory must be MemFree()
*
* @param {Buffer} compData
* @param {number} compDataSize
* @param {number} dataSize
*
* @return {Buffer} The resulting unsigned char *.
*/
function DecompressData(compData, compDataSize, dataSize) {
return r.BindDecompressData(
compData,
compDataSize,
dataSize
)
}
raylib.DecompressData = DecompressData
/**
* Encode data to Base64 string, memory must be MemFree()
*
* @param {Buffer} data
* @param {number} dataSize
* @param {number} outputSize
*
* @return {string} The resulting char *.
*/
function EncodeDataBase64(data, dataSize, outputSize) {
return r.BindEncodeDataBase64(
data,
dataSize,
outputSize
)
}
raylib.EncodeDataBase64 = EncodeDataBase64
/**
* Decode Base64 string data, memory must be MemFree()
*
* @param {Buffer} data
* @param {number} outputSize
*
* @return {Buffer} The resulting unsigned char *.
*/
function DecodeDataBase64(data, outputSize) {
return r.BindDecodeDataBase64(
data,
outputSize
)
}
raylib.DecodeDataBase64 = DecodeDataBase64
/**
* Compute CRC32 hash code
*
* @param {Buffer} data
* @param {number} dataSize
*
* @return {number} The resulting unsigned int.
*/
function ComputeCRC32(data, dataSize) {
return r.BindComputeCRC32(
data,
dataSize
)
}
raylib.ComputeCRC32 = ComputeCRC32
/**
* Compute MD5 hash code, returns static int[4] (16 bytes)
*
* @param {Buffer} data
* @param {number} dataSize
*
* @return {number} The resulting unsigned int *.
*/
function ComputeMD5(data, dataSize) {
return r.BindComputeMD5(
data,
dataSize
)
}
raylib.ComputeMD5 = ComputeMD5
/**
* Compute SHA1 hash code, returns static int[5] (20 bytes)
*
* @param {Buffer} data
* @param {number} dataSize
*
* @return {number} The resulting unsigned int *.
*/
function ComputeSHA1(data, dataSize) {
return r.BindComputeSHA1(
data,
dataSize
)
}
raylib.ComputeSHA1 = ComputeSHA1
/**
* Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
*
* @param {string} fileName
*
* @return {AutomationEventList} The resulting AutomationEventList.
*/
function LoadAutomationEventList(fileName) {
return r.BindLoadAutomationEventList(
fileName
)
}
raylib.LoadAutomationEventList = LoadAutomationEventList
/**
* Unload automation events list from file
*
* @param {AutomationEventList} list
*
* @return {undefined}
*/
function UnloadAutomationEventList(list) {
return r.BindUnloadAutomationEventList(
list.capacity,
list.count,
list.events
)
}
raylib.UnloadAutomationEventList = UnloadAutomationEventList
/**
* Export automation events list as text file
*
* @param {AutomationEventList} list
* @param {string} fileName
*
* @return {boolean} The resulting bool.
*/
function ExportAutomationEventList(list, fileName) {
return r.BindExportAutomationEventList(
list.capacity,
list.count,
list.events,
fileName
)
}
raylib.ExportAutomationEventList = ExportAutomationEventList
/**
* Set automation event list to record to
*
* @param {number} list
*
* @return {undefined}
*/
function SetAutomationEventList(list) {
return r.BindSetAutomationEventList(
list
)
}
raylib.SetAutomationEventList = SetAutomationEventList
/**
* Set automation event internal base frame to start recording
*
* @param {number} frame
*
* @return {undefined}
*/
function SetAutomationEventBaseFrame(frame) {
return r.BindSetAutomationEventBaseFrame(
frame
)
}
raylib.SetAutomationEventBaseFrame = SetAutomationEventBaseFrame
/**
* Start recording automation events (AutomationEventList must be set)
*
* @return {undefined}
*/
function StartAutomationEventRecording() {
return r.BindStartAutomationEventRecording()
}
raylib.StartAutomationEventRecording = StartAutomationEventRecording
/**
* Stop recording automation events
*
* @return {undefined}
*/
function StopAutomationEventRecording() {
return r.BindStopAutomationEventRecording()
}
raylib.StopAutomationEventRecording = StopAutomationEventRecording
/**
* Play a recorded automation event
*
* @param {AutomationEvent} event
*
* @return {undefined}
*/
function PlayAutomationEvent(event) {
return r.BindPlayAutomationEvent(
event.frame,
event.type,
event.params
)
}
raylib.PlayAutomationEvent = PlayAutomationEvent
/**
* Check if a key has been pressed once
*
* @param {number} key
*
* @return {boolean} The resulting bool.
*/
function IsKeyPressed(key) {
return r.BindIsKeyPressed(
key
)
}
raylib.IsKeyPressed = IsKeyPressed
/**
* Check if a key has been pressed again
*
* @param {number} key
*
* @return {boolean} The resulting bool.
*/
function IsKeyPressedRepeat(key) {
return r.BindIsKeyPressedRepeat(
key
)
}
raylib.IsKeyPressedRepeat = IsKeyPressedRepeat
/**
* Check if a key is being pressed
*
* @param {number} key
*
* @return {boolean} The resulting bool.
*/
function IsKeyDown(key) {
return r.BindIsKeyDown(
key
)
}
raylib.IsKeyDown = IsKeyDown
/**
* Check if a key has been released once
*
* @param {number} key
*
* @return {boolean} The resulting bool.
*/
function IsKeyReleased(key) {
return r.BindIsKeyReleased(
key
)
}
raylib.IsKeyReleased = IsKeyReleased
/**
* Check if a key is NOT being pressed
*
* @param {number} key
*
* @return {boolean} The resulting bool.
*/
function IsKeyUp(key) {
return r.BindIsKeyUp(
key
)
}
raylib.IsKeyUp = IsKeyUp
/**
* Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
*
* @return {number} The resulting int.
*/
function GetKeyPressed() {
return r.BindGetKeyPressed()
}
raylib.GetKeyPressed = GetKeyPressed
/**
* Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
*
* @return {number} The resulting int.
*/
function GetCharPressed() {
return r.BindGetCharPressed()
}
raylib.GetCharPressed = GetCharPressed
/**
* Set a custom key to exit program (default is ESC)
*
* @param {number} key
*
* @return {undefined}
*/
function SetExitKey(key) {
return r.BindSetExitKey(
key
)
}
raylib.SetExitKey = SetExitKey
/**
* Check if a gamepad is available
*
* @param {number} gamepad
*
* @return {boolean} The resulting bool.
*/
function IsGamepadAvailable(gamepad) {
return r.BindIsGamepadAvailable(
gamepad
)
}
raylib.IsGamepadAvailable = IsGamepadAvailable
/**
* Get gamepad internal name id
*
* @param {number} gamepad
*
* @return {string} The resulting const char *.
*/
function GetGamepadName(gamepad) {
return r.BindGetGamepadName(
gamepad
)
}
raylib.GetGamepadName = GetGamepadName
/**
* Check if a gamepad button has been pressed once
*
* @param {number} gamepad
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsGamepadButtonPressed(gamepad, button) {
return r.BindIsGamepadButtonPressed(
gamepad,
button
)
}
raylib.IsGamepadButtonPressed = IsGamepadButtonPressed
/**
* Check if a gamepad button is being pressed
*
* @param {number} gamepad
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsGamepadButtonDown(gamepad, button) {
return r.BindIsGamepadButtonDown(
gamepad,
button
)
}
raylib.IsGamepadButtonDown = IsGamepadButtonDown
/**
* Check if a gamepad button has been released once
*
* @param {number} gamepad
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsGamepadButtonReleased(gamepad, button) {
return r.BindIsGamepadButtonReleased(
gamepad,
button
)
}
raylib.IsGamepadButtonReleased = IsGamepadButtonReleased
/**
* Check if a gamepad button is NOT being pressed
*
* @param {number} gamepad
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsGamepadButtonUp(gamepad, button) {
return r.BindIsGamepadButtonUp(
gamepad,
button
)
}
raylib.IsGamepadButtonUp = IsGamepadButtonUp
/**
* Get the last gamepad button pressed
*
* @return {number} The resulting int.
*/
function GetGamepadButtonPressed() {
return r.BindGetGamepadButtonPressed()
}
raylib.GetGamepadButtonPressed = GetGamepadButtonPressed
/**
* Get gamepad axis count for a gamepad
*
* @param {number} gamepad
*
* @return {number} The resulting int.
*/
function GetGamepadAxisCount(gamepad) {
return r.BindGetGamepadAxisCount(
gamepad
)
}
raylib.GetGamepadAxisCount = GetGamepadAxisCount
/**
* Get axis movement value for a gamepad axis
*
* @param {number} gamepad
* @param {number} axis
*
* @return {number} The resulting float.
*/
function GetGamepadAxisMovement(gamepad, axis) {
return r.BindGetGamepadAxisMovement(
gamepad,
axis
)
}
raylib.GetGamepadAxisMovement = GetGamepadAxisMovement
/**
* Set internal gamepad mappings (SDL_GameControllerDB)
*
* @param {string} mappings
*
* @return {number} The resulting int.
*/
function SetGamepadMappings(mappings) {
return r.BindSetGamepadMappings(
mappings
)
}
raylib.SetGamepadMappings = SetGamepadMappings
/**
* Set gamepad vibration for both motors (duration in seconds)
*
* @param {number} gamepad
* @param {number} leftMotor
* @param {number} rightMotor
* @param {number} duration
*
* @return {undefined}
*/
function SetGamepadVibration(gamepad, leftMotor, rightMotor, duration) {
return r.BindSetGamepadVibration(
gamepad,
leftMotor,
rightMotor,
duration
)
}
raylib.SetGamepadVibration = SetGamepadVibration
/**
* Check if a mouse button has been pressed once
*
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsMouseButtonPressed(button) {
return r.BindIsMouseButtonPressed(
button
)
}
raylib.IsMouseButtonPressed = IsMouseButtonPressed
/**
* Check if a mouse button is being pressed
*
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsMouseButtonDown(button) {
return r.BindIsMouseButtonDown(
button
)
}
raylib.IsMouseButtonDown = IsMouseButtonDown
/**
* Check if a mouse button has been released once
*
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsMouseButtonReleased(button) {
return r.BindIsMouseButtonReleased(
button
)
}
raylib.IsMouseButtonReleased = IsMouseButtonReleased
/**
* Check if a mouse button is NOT being pressed
*
* @param {number} button
*
* @return {boolean} The resulting bool.
*/
function IsMouseButtonUp(button) {
return r.BindIsMouseButtonUp(
button
)
}
raylib.IsMouseButtonUp = IsMouseButtonUp
/**
* Get mouse position X
*
* @return {number} The resulting int.
*/
function GetMouseX() {
return r.BindGetMouseX()
}
raylib.GetMouseX = GetMouseX
/**
* Get mouse position Y
*
* @return {number} The resulting int.
*/
function GetMouseY() {
return r.BindGetMouseY()
}
raylib.GetMouseY = GetMouseY
/**
* Get mouse position XY
*
* @return {Vector2} The resulting Vector2.
*/
function GetMousePosition() {
return r.BindGetMousePosition()
}
raylib.GetMousePosition = GetMousePosition
/**
* Get mouse delta between frames
*
* @return {Vector2} The resulting Vector2.
*/
function GetMouseDelta() {
return r.BindGetMouseDelta()
}
raylib.GetMouseDelta = GetMouseDelta
/**
* Set mouse position XY
*
* @param {number} x
* @param {number} y
*
* @return {undefined}
*/
function SetMousePosition(x, y) {
return r.BindSetMousePosition(
x,
y
)
}
raylib.SetMousePosition = SetMousePosition
/**
* Set mouse offset
*
* @param {number} offsetX
* @param {number} offsetY
*
* @return {undefined}
*/
function SetMouseOffset(offsetX, offsetY) {
return r.BindSetMouseOffset(
offsetX,
offsetY
)
}
raylib.SetMouseOffset = SetMouseOffset
/**
* Set mouse scaling
*
* @param {number} scaleX
* @param {number} scaleY
*
* @return {undefined}
*/
function SetMouseScale(scaleX, scaleY) {
return r.BindSetMouseScale(
scaleX,
scaleY
)
}
raylib.SetMouseScale = SetMouseScale
/**
* Get mouse wheel movement for X or Y, whichever is larger
*
* @return {number} The resulting float.
*/
function GetMouseWheelMove() {
return r.BindGetMouseWheelMove()
}
raylib.GetMouseWheelMove = GetMouseWheelMove
/**
* Get mouse wheel movement for both X and Y
*
* @return {Vector2} The resulting Vector2.
*/
function GetMouseWheelMoveV() {
return r.BindGetMouseWheelMoveV()
}
raylib.GetMouseWheelMoveV = GetMouseWheelMoveV
/**
* Set mouse cursor
*
* @param {number} cursor
*
* @return {undefined}
*/
function SetMouseCursor(cursor) {
return r.BindSetMouseCursor(
cursor
)
}
raylib.SetMouseCursor = SetMouseCursor
/**
* Get touch position X for touch point 0 (relative to screen size)
*
* @return {number} The resulting int.
*/
function GetTouchX() {
return r.BindGetTouchX()
}
raylib.GetTouchX = GetTouchX
/**
* Get touch position Y for touch point 0 (relative to screen size)
*
* @return {number} The resulting int.
*/
function GetTouchY() {
return r.BindGetTouchY()
}
raylib.GetTouchY = GetTouchY
/**
* Get touch position XY for a touch point index (relative to screen size)
*
* @param {number} index
*
* @return {Vector2} The resulting Vector2.
*/
function GetTouchPosition(index) {
return r.BindGetTouchPosition(
index
)
}
raylib.GetTouchPosition = GetTouchPosition
/**
* Get touch point identifier for given index
*
* @param {number} index
*
* @return {number} The resulting int.
*/
function GetTouchPointId(index) {
return r.BindGetTouchPointId(
index
)
}
raylib.GetTouchPointId = GetTouchPointId
/**
* Get number of touch points
*
* @return {number} The resulting int.
*/
function GetTouchPointCount() {
return r.BindGetTouchPointCount()
}
raylib.GetTouchPointCount = GetTouchPointCount
/**
* Enable a set of gestures using flags
*
* @param {number} flags
*
* @return {undefined}
*/
function SetGesturesEnabled(flags) {
return r.BindSetGesturesEnabled(
flags
)
}
raylib.SetGesturesEnabled = SetGesturesEnabled
/**
* Check if a gesture have been detected
*
* @param {number} gesture
*
* @return {boolean