Standard library · Graphics and games

gui/raylib

Games and graphics with raylib: windows, 2D and 3D drawing, textures, text, input and audio.

import gui.raylib

This package binds raylib 5.5, a small library for 2D and 3D games and graphics programs. It opens a window with an OpenGL context, and gives drawing of shapes, textures, text and 3D models, keyboard, mouse, gamepad and touch input, and sound and music. The names are the ones of the raylib cheat sheet, so every raylib tutorial reads almost the same in Salam.

Use it for games, visual toys, tools with a custom picture and teaching programs. For forms and buttons use a layout or the webview package, and for pictures that are only saved to a file the image package needs no outside library.

Things to know

  • Programs link against the raylib shared library (libraylib, version 5.5). Install it with your package manager or build it from source; if it is missing, the build fails at the link step.
  • Raylib passes Color, Vector2, Rectangle, Camera3D and the other structs by value. Salam passes them the way the C compiler of the platform does, on x86-64 (System V and Windows) and AArch64. The --backend=native compiler refuses such calls with a clear message; use the default backend.
  • Raylib works with 32-bit floats. Every function that takes a f32 also has a version that takes f64, so DrawCircle(400, 225, 50.0, Red()) works. Struct fields are f32; build vectors and rectangles with Vec2, Vec3 and Rect.
  • Colors are functions: Red(), RayWhite(), Blank(). Build your own with RGB and RGBA.
  • Functions that change a value in place, such as ImageResize and UpdateCamera, take a variable and need it declared with mut.
  • Strings returned by raylib, such as GetMonitorName, belong to raylib: copy them if you keep them and never free them.
  • Everything you load (LoadTexture, LoadSound, LoadModel, ...) has an Unload call; raylib does not free it for you before the window closes.
  • The window needs a desktop session, so the examples on this page are only type-checked by the site.

A bouncing ball

Every raylib program has the same shape: open a window, ask for a frame rate, then loop until WindowShouldClose, drawing between BeginDrawing and EndDrawing. GetFrameTime gives the seconds since the last frame, which keeps movement the same speed on every machine.

gui-raylib-guide-ball.salam
import gui.raylib

func main:
    raylib.InitWindow(800, 450, "Bouncing ball")
    raylib.SetTargetFPS(60)
    mut x := 400.0
    mut y := 225.0
    mut dx := 240.0
    mut dy := 180.0
    until not raylib.WindowShouldClose():
        dt := raylib.GetFrameTime() as f64
        x += dx * dt
        y += dy * dt
        if x < 20.0 or x > 780.0:
            dx = 0.0 - dx
        end
        if y < 20.0 or y > 430.0:
            dy = 0.0 - dy
        end
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawCircle(x as int, y as int, 20.0, raylib.Maroon())
        raylib.DrawText("Close the window to quit", 10, 10, 20, raylib.DarkGray())
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

Keyboard and collisions

IsKeyDown reports a key that is held, IsKeyPressed only the frame it went down. CheckCollisionRecs tests two rectangles, which is enough for many 2D games: try the move first and keep it only when it does not hit the wall.

gui-raylib-guide-input.salam
import gui.raylib

func main:
    raylib.InitWindow(800, 450, "Move the square")
    raylib.SetTargetFPS(60)
    mut px := 100.0
    mut py := 100.0
    wall := raylib.Rect(500.0, 150.0, 60.0, 150.0)
    until not raylib.WindowShouldClose():
        dt := raylib.GetFrameTime() as f64
        mut nx := px
        mut ny := py
        if raylib.IsKeyDown(raylib.KEY_RIGHT): nx += 200.0 * dt end
        if raylib.IsKeyDown(raylib.KEY_LEFT): nx -= 200.0 * dt end
        if raylib.IsKeyDown(raylib.KEY_DOWN): ny += 200.0 * dt end
        if raylib.IsKeyDown(raylib.KEY_UP): ny -= 200.0 * dt end
        player := raylib.Rect(nx, ny, 40.0, 40.0)
        if not raylib.CheckCollisionRecs(player, wall):
            px = nx
            py = ny
        end
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawRectangleRec(wall, raylib.DarkGray())
        raylib.DrawRectangle(px as int, py as int, 40, 40, raylib.Blue())
        raylib.DrawText("Arrow keys move the square", 10, 10, 20, raylib.Gray())
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

A 3D scene

3D drawing sits between BeginMode3D and EndMode3D and uses a Camera3D. UpdateCamera with CAMERA_ORBITAL turns the camera around its target; it changes the camera, so declare it with mut.

gui-raylib-guide-3d.salam
import gui.raylib

func main:
    raylib.InitWindow(800, 450, "3D cube")
    raylib.SetTargetFPS(60)
    mut camera := raylib.NewCamera3D(raylib.Vec3(6.0, 6.0, 6.0), raylib.Vec3(0.0, 1.0, 0.0), raylib.Vec3(0.0, 1.0, 0.0), 45.0, raylib.CAMERA_PERSPECTIVE)
    until not raylib.WindowShouldClose():
        raylib.UpdateCamera(camera, raylib.CAMERA_ORBITAL)
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.BeginMode3D(camera)
        raylib.DrawCube(raylib.Vec3(0.0, 1.0, 0.0), 2.0, 2.0, 2.0, raylib.Red())
        raylib.DrawCubeWires(raylib.Vec3(0.0, 1.0, 0.0), 2.0, 2.0, 2.0, raylib.Maroon())
        raylib.DrawGrid(10, 1.0)
        raylib.EndMode3D()
        raylib.DrawFPS(10, 10)
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

Types

Vector2

struct Vector2
A 2D vector.
NameTypeDescription
xf32 = 0The x field.
yf32 = 0The y field.

Vector3

struct Vector3
A 3D vector.
NameTypeDescription
xf32 = 0The x field.
yf32 = 0The y field.
zf32 = 0The z field.

Vector4

struct Vector4
A 4D vector, also used as a quaternion.
NameTypeDescription
xf32 = 0The x field.
yf32 = 0The y field.
zf32 = 0The z field.
wf32 = 0The w field.

Matrix

struct Matrix
A 4x4 matrix.
NameTypeDescription
m0f32 = 0The m0 field.
m4f32 = 0The m4 field.
m8f32 = 0The m8 field.
m12f32 = 0The m12 field.
m1f32 = 0The m1 field.
m5f32 = 0The m5 field.
m9f32 = 0The m9 field.
m13f32 = 0The m13 field.
m2f32 = 0The m2 field.
m6f32 = 0The m6 field.
m10f32 = 0The m10 field.
m14f32 = 0The m14 field.
m3f32 = 0The m3 field.
m7f32 = 0The m7 field.
m11f32 = 0The m11 field.
m15f32 = 0The m15 field.

Color

struct Color
A color with red, green, blue and alpha bytes.
NameTypeDescription
ru8 = 0The r field.
gu8 = 0The g field.
bu8 = 0The b field.
au8 = 0The a field.

Rectangle

struct Rectangle
A rectangle with a position and a size.
NameTypeDescription
xf32 = 0The x field.
yf32 = 0The y field.
widthf32 = 0The width field.
heightf32 = 0The height field.

Image

struct Image
Pixel data in CPU memory.
NameTypeDescription
datavoid*The data field.
widthint = 0The width field.
heightint = 0The height field.
mipmapsint = 0The mipmaps field.
formatint = 0The format field.

Texture

struct Texture
A texture stored in GPU memory.
NameTypeDescription
idu32 = 0The id field.
widthint = 0The width field.
heightint = 0The height field.
mipmapsint = 0The mipmaps field.
formatint = 0The format field.

RenderTexture

struct RenderTexture
A texture you can draw into.
NameTypeDescription
idu32 = 0The id field.
textureTextureThe texture field.
depthTextureThe depth field.

NPatchInfo

struct NPatchInfo
Describes a nine-patch texture.
NameTypeDescription
sourceRectangleThe source field.
leftint = 0The left field.
topint = 0The top field.
rightint = 0The right field.
bottomint = 0The bottom field.
layoutKindint = 0The layoutKind field.

GlyphInfo

struct GlyphInfo
Metrics and pixels of one font glyph.
NameTypeDescription
valueint = 0The value field.
offsetXint = 0The offsetX field.
offsetYint = 0The offsetY field.
advanceXint = 0The advanceX field.
imageImageThe image field.

Font

struct Font
A font made of glyph rectangles in a texture.
NameTypeDescription
baseSizeint = 0The baseSize field.
glyphCountint = 0The glyphCount field.
glyphPaddingint = 0The glyphPadding field.
textureTextureThe texture field.
recsRectangle*The recs field.
glyphsGlyphInfo*The glyphs field.

Camera3D

struct Camera3D
A 3D camera.
NameTypeDescription
positionVector3The position field.
targetVector3The target field.
upVector3The up field.
fovyf32 = 0The fovy field.
projectionint = 0The projection field.

Camera2D

struct Camera2D
A 2D camera.
NameTypeDescription
offsetVector2The offset field.
targetVector2The target field.
rotationf32 = 0The rotation field.
zoomf32 = 0The zoom field.

Mesh

struct Mesh
Vertex data of a 3D shape.
NameTypeDescription
vertexCountint = 0The vertexCount field.
triangleCountint = 0The triangleCount field.
verticesf32*The vertices field.
texcoordsf32*The texcoords field.
texcoords2f32*The texcoords2 field.
normalsf32*The normals field.
tangentsf32*The tangents field.
colorsu8*The colors field.
indicesu16*The indices field.
animVerticesf32*The animVertices field.
animNormalsf32*The animNormals field.
boneIdsu8*The boneIds field.
boneWeightsf32*The boneWeights field.
boneMatricesMatrix*The boneMatrices field.
boneCountint = 0The boneCount field.
vaoIdu32 = 0The vaoId field.
vboIdu32*The vboId field.

Shader

struct Shader
A GPU shader program.
NameTypeDescription
idu32 = 0The id field.
locsint*The locs field.

MaterialMap

struct MaterialMap
One texture slot of a material.
NameTypeDescription
textureTextureThe texture field.
colorColorThe color field.
valuef32 = 0The value field.

Material

struct Material
A shader with its texture maps.
NameTypeDescription
shaderShaderThe shader field.
mapsMaterialMap*The maps field.
param0f32 = 0The param0 field.
param1f32 = 0The param1 field.
param2f32 = 0The param2 field.
param3f32 = 0The param3 field.

Transform

struct Transform
Translation, rotation and scale.
NameTypeDescription
translationVector3The translation field.
rotationVector4The rotation field.
scaleVector3The scale field.

BoneInfo

struct BoneInfo
A skeleton bone (the name is stored as eight 32-bit words).
NameTypeDescription
name0u32 = 0The name0 field.
name1u32 = 0The name1 field.
name2u32 = 0The name2 field.
name3u32 = 0The name3 field.
name4u32 = 0The name4 field.
name5u32 = 0The name5 field.
name6u32 = 0The name6 field.
name7u32 = 0The name7 field.
parentint = 0The parent field.

Model

struct Model
A set of meshes and materials.
NameTypeDescription
transformMatrixThe transform field.
meshCountint = 0The meshCount field.
materialCountint = 0The materialCount field.
meshesMesh*The meshes field.
materialsMaterial*The materials field.
meshMaterialint*The meshMaterial field.
boneCountint = 0The boneCount field.
bonesBoneInfo*The bones field.
bindPoseTransform*The bindPose field.

ModelAnimation

struct ModelAnimation
A skeletal animation for a model.
NameTypeDescription
boneCountint = 0The boneCount field.
frameCountint = 0The frameCount field.
bonesBoneInfo*The bones field.
framePosesvoid*The framePoses field.
name0u32 = 0The name0 field.
name1u32 = 0The name1 field.
name2u32 = 0The name2 field.
name3u32 = 0The name3 field.
name4u32 = 0The name4 field.
name5u32 = 0The name5 field.
name6u32 = 0The name6 field.
name7u32 = 0The name7 field.

Ray

struct Ray
A ray with a start and a direction.
NameTypeDescription
positionVector3The position field.
directionVector3The direction field.

RayCollision

struct RayCollision
The result of a ray test.
NameTypeDescription
hitbool = falseThe hit field.
distancef32 = 0The distance field.
pointVector3The point field.
normalVector3The normal field.

BoundingBox

struct BoundingBox
An axis-aligned box.
NameTypeDescription
minVector3The min field.
maxVector3The max field.

Wave

struct Wave
Decoded audio samples.
NameTypeDescription
frameCountu32 = 0The frameCount field.
sampleRateu32 = 0The sampleRate field.
sampleSizeu32 = 0The sampleSize field.
channelsu32 = 0The channels field.
datavoid*The data field.

AudioStream

struct AudioStream
A raw audio stream.
NameTypeDescription
buffervoid*The buffer field.
processorvoid*The processor field.
sampleRateu32 = 0The sampleRate field.
sampleSizeu32 = 0The sampleSize field.
channelsu32 = 0The channels field.

Sound

struct Sound
A short sound loaded in memory.
NameTypeDescription
streamAudioStreamThe stream field.
frameCountu32 = 0The frameCount field.

Music

struct Music
A streamed music file.
NameTypeDescription
streamAudioStreamThe stream field.
frameCountu32 = 0The frameCount field.
loopingbool = falseThe looping field.
ctxTypeint = 0The ctxType field.
ctxDatavoid*The ctxData field.

FilePathList

struct FilePathList
A list of file paths.
NameTypeDescription
capacityu32 = 0The capacity field.
countu32 = 0The count field.
pathsvoid*The paths field.

Constants and variables

KEY_NULL

const KEY_NULL: i32 = 0
Keyboard key code: null.

KEY_APOSTROPHE

const KEY_APOSTROPHE: i32 = 39
Keyboard key code: apostrophe.

KEY_COMMA

const KEY_COMMA: i32 = 44
Keyboard key code: comma.

KEY_MINUS

const KEY_MINUS: i32 = 45
Keyboard key code: minus.

KEY_PERIOD

const KEY_PERIOD: i32 = 46
Keyboard key code: period.

KEY_SLASH

const KEY_SLASH: i32 = 47
Keyboard key code: slash.

KEY_SEMICOLON

const KEY_SEMICOLON: i32 = 59
Keyboard key code: semicolon.

KEY_EQUAL

const KEY_EQUAL: i32 = 61
Keyboard key code: equal.

KEY_LEFT_BRACKET

const KEY_LEFT_BRACKET: i32 = 91
Keyboard key code: left bracket.

KEY_BACKSLASH

const KEY_BACKSLASH: i32 = 92
Keyboard key code: backslash.

KEY_RIGHT_BRACKET

const KEY_RIGHT_BRACKET: i32 = 93
Keyboard key code: right bracket.

KEY_GRAVE

const KEY_GRAVE: i32 = 96
Keyboard key code: grave.

KEY_SPACE

const KEY_SPACE: i32 = 32
Keyboard key code: space.

KEY_ESCAPE

const KEY_ESCAPE: i32 = 256
Keyboard key code: escape.

KEY_ENTER

const KEY_ENTER: i32 = 257
Keyboard key code: enter.

KEY_TAB

const KEY_TAB: i32 = 258
Keyboard key code: tab.

KEY_BACKSPACE

const KEY_BACKSPACE: i32 = 259
Keyboard key code: backspace.

KEY_INSERT

const KEY_INSERT: i32 = 260
Keyboard key code: insert.

KEY_DELETE

const KEY_DELETE: i32 = 261
Keyboard key code: delete.

KEY_RIGHT

const KEY_RIGHT: i32 = 262
Keyboard key code: right.

KEY_LEFT

const KEY_LEFT: i32 = 263
Keyboard key code: left.

KEY_DOWN

const KEY_DOWN: i32 = 264
Keyboard key code: down.

KEY_UP

const KEY_UP: i32 = 265
Keyboard key code: up.

KEY_PAGE_UP

const KEY_PAGE_UP: i32 = 266
Keyboard key code: page up.

KEY_PAGE_DOWN

const KEY_PAGE_DOWN: i32 = 267
Keyboard key code: page down.

KEY_HOME

const KEY_HOME: i32 = 268
Keyboard key code: home.

KEY_END

const KEY_END: i32 = 269
Keyboard key code: end.

KEY_CAPS_LOCK

const KEY_CAPS_LOCK: i32 = 280
Keyboard key code: caps lock.

KEY_SCROLL_LOCK

const KEY_SCROLL_LOCK: i32 = 281
Keyboard key code: scroll lock.

KEY_NUM_LOCK

const KEY_NUM_LOCK: i32 = 282
Keyboard key code: num lock.

KEY_PRINT_SCREEN

const KEY_PRINT_SCREEN: i32 = 283
Keyboard key code: print screen.

KEY_PAUSE

const KEY_PAUSE: i32 = 284
Keyboard key code: pause.

KEY_LEFT_SHIFT

const KEY_LEFT_SHIFT: i32 = 340
Keyboard key code: left shift.

KEY_LEFT_CONTROL

const KEY_LEFT_CONTROL: i32 = 341
Keyboard key code: left control.

KEY_LEFT_ALT

const KEY_LEFT_ALT: i32 = 342
Keyboard key code: left alt.

KEY_LEFT_SUPER

const KEY_LEFT_SUPER: i32 = 343
Keyboard key code: left super.

KEY_RIGHT_SHIFT

const KEY_RIGHT_SHIFT: i32 = 344
Keyboard key code: right shift.

KEY_RIGHT_CONTROL

const KEY_RIGHT_CONTROL: i32 = 345
Keyboard key code: right control.

KEY_RIGHT_ALT

const KEY_RIGHT_ALT: i32 = 346
Keyboard key code: right alt.

KEY_RIGHT_SUPER

const KEY_RIGHT_SUPER: i32 = 347
Keyboard key code: right super.

KEY_KB_MENU

const KEY_KB_MENU: i32 = 348
Keyboard key code: kb menu.

KEY_ZERO

const KEY_ZERO: i32 = 48
Keyboard key code: zero.

KEY_ONE

const KEY_ONE: i32 = 49
Keyboard key code: one.

KEY_TWO

const KEY_TWO: i32 = 50
Keyboard key code: two.

KEY_THREE

const KEY_THREE: i32 = 51
Keyboard key code: three.

KEY_FOUR

const KEY_FOUR: i32 = 52
Keyboard key code: four.

KEY_FIVE

const KEY_FIVE: i32 = 53
Keyboard key code: five.

KEY_SIX

const KEY_SIX: i32 = 54
Keyboard key code: six.

KEY_SEVEN

const KEY_SEVEN: i32 = 55
Keyboard key code: seven.

KEY_EIGHT

const KEY_EIGHT: i32 = 56
Keyboard key code: eight.

KEY_NINE

const KEY_NINE: i32 = 57
Keyboard key code: nine.

KEY_A

const KEY_A: i32 = 65
Keyboard key code: a.

KEY_B

const KEY_B: i32 = 66
Keyboard key code: b.

KEY_C

const KEY_C: i32 = 67
Keyboard key code: c.

KEY_D

const KEY_D: i32 = 68
Keyboard key code: d.

KEY_E

const KEY_E: i32 = 69
Keyboard key code: e.

KEY_F

const KEY_F: i32 = 70
Keyboard key code: f.

KEY_G

const KEY_G: i32 = 71
Keyboard key code: g.

KEY_H

const KEY_H: i32 = 72
Keyboard key code: h.

KEY_I

const KEY_I: i32 = 73
Keyboard key code: i.

KEY_J

const KEY_J: i32 = 74
Keyboard key code: j.

KEY_K

const KEY_K: i32 = 75
Keyboard key code: k.

KEY_L

const KEY_L: i32 = 76
Keyboard key code: l.

KEY_M

const KEY_M: i32 = 77
Keyboard key code: m.

KEY_N

const KEY_N: i32 = 78
Keyboard key code: n.

KEY_O

const KEY_O: i32 = 79
Keyboard key code: o.

KEY_P

const KEY_P: i32 = 80
Keyboard key code: p.

KEY_Q

const KEY_Q: i32 = 81
Keyboard key code: q.

KEY_R

const KEY_R: i32 = 82
Keyboard key code: r.

KEY_S

const KEY_S: i32 = 83
Keyboard key code: s.

KEY_T

const KEY_T: i32 = 84
Keyboard key code: t.

KEY_U

const KEY_U: i32 = 85
Keyboard key code: u.

KEY_V

const KEY_V: i32 = 86
Keyboard key code: v.

KEY_W

const KEY_W: i32 = 87
Keyboard key code: w.

KEY_X

const KEY_X: i32 = 88
Keyboard key code: x.

KEY_Y

const KEY_Y: i32 = 89
Keyboard key code: y.

KEY_Z

const KEY_Z: i32 = 90
Keyboard key code: z.

KEY_F1

const KEY_F1: i32 = 290
Keyboard key code: f1.

KEY_F2

const KEY_F2: i32 = 291
Keyboard key code: f2.

KEY_F3

const KEY_F3: i32 = 292
Keyboard key code: f3.

KEY_F4

const KEY_F4: i32 = 293
Keyboard key code: f4.

KEY_F5

const KEY_F5: i32 = 294
Keyboard key code: f5.

KEY_F6

const KEY_F6: i32 = 295
Keyboard key code: f6.

KEY_F7

const KEY_F7: i32 = 296
Keyboard key code: f7.

KEY_F8

const KEY_F8: i32 = 297
Keyboard key code: f8.

KEY_F9

const KEY_F9: i32 = 298
Keyboard key code: f9.

KEY_F10

const KEY_F10: i32 = 299
Keyboard key code: f10.

KEY_F11

const KEY_F11: i32 = 300
Keyboard key code: f11.

KEY_F12

const KEY_F12: i32 = 301
Keyboard key code: f12.

KEY_KP_0

const KEY_KP_0: i32 = 320
Keyboard key code: kp 0.

KEY_KP_1

const KEY_KP_1: i32 = 321
Keyboard key code: kp 1.

KEY_KP_2

const KEY_KP_2: i32 = 322
Keyboard key code: kp 2.

KEY_KP_3

const KEY_KP_3: i32 = 323
Keyboard key code: kp 3.

KEY_KP_4

const KEY_KP_4: i32 = 324
Keyboard key code: kp 4.

KEY_KP_5

const KEY_KP_5: i32 = 325
Keyboard key code: kp 5.

KEY_KP_6

const KEY_KP_6: i32 = 326
Keyboard key code: kp 6.

KEY_KP_7

const KEY_KP_7: i32 = 327
Keyboard key code: kp 7.

KEY_KP_8

const KEY_KP_8: i32 = 328
Keyboard key code: kp 8.

KEY_KP_9

const KEY_KP_9: i32 = 329
Keyboard key code: kp 9.

KEY_KP_DECIMAL

const KEY_KP_DECIMAL: i32 = 330
Keyboard key code: kp decimal.

KEY_KP_DIVIDE

const KEY_KP_DIVIDE: i32 = 331
Keyboard key code: kp divide.

KEY_KP_MULTIPLY

const KEY_KP_MULTIPLY: i32 = 332
Keyboard key code: kp multiply.

KEY_KP_SUBTRACT

const KEY_KP_SUBTRACT: i32 = 333
Keyboard key code: kp subtract.

KEY_KP_ADD

const KEY_KP_ADD: i32 = 334
Keyboard key code: kp add.

KEY_KP_ENTER

const KEY_KP_ENTER: i32 = 335
Keyboard key code: kp enter.

KEY_KP_EQUAL

const KEY_KP_EQUAL: i32 = 336
Keyboard key code: kp equal.

FLAG_VSYNC_HINT

const FLAG_VSYNC_HINT: u32 = 64
Window or config flag: vsync hint.

FLAG_FULLSCREEN_MODE

const FLAG_FULLSCREEN_MODE: u32 = 2
Window or config flag: fullscreen mode.

FLAG_WINDOW_RESIZABLE

const FLAG_WINDOW_RESIZABLE: u32 = 4
Window or config flag: window resizable.

FLAG_WINDOW_UNDECORATED

const FLAG_WINDOW_UNDECORATED: u32 = 8
Window or config flag: window undecorated.

FLAG_WINDOW_HIDDEN

const FLAG_WINDOW_HIDDEN: u32 = 128
Window or config flag: window hidden.

FLAG_WINDOW_MINIMIZED

const FLAG_WINDOW_MINIMIZED: u32 = 512
Window or config flag: window minimized.

FLAG_WINDOW_MAXIMIZED

const FLAG_WINDOW_MAXIMIZED: u32 = 1024
Window or config flag: window maximized.

FLAG_WINDOW_UNFOCUSED

const FLAG_WINDOW_UNFOCUSED: u32 = 2048
Window or config flag: window unfocused.

FLAG_WINDOW_TOPMOST

const FLAG_WINDOW_TOPMOST: u32 = 4096
Window or config flag: window topmost.

FLAG_WINDOW_ALWAYS_RUN

const FLAG_WINDOW_ALWAYS_RUN: u32 = 256
Window or config flag: window always run.

FLAG_WINDOW_TRANSPARENT

const FLAG_WINDOW_TRANSPARENT: u32 = 16
Window or config flag: window transparent.

FLAG_WINDOW_HIGHDPI

const FLAG_WINDOW_HIGHDPI: u32 = 8192
Window or config flag: window highdpi.

FLAG_WINDOW_MOUSE_PASSTHROUGH

const FLAG_WINDOW_MOUSE_PASSTHROUGH: u32 = 16384
Window or config flag: window mouse passthrough.

FLAG_BORDERLESS_WINDOWED_MODE

const FLAG_BORDERLESS_WINDOWED_MODE: u32 = 32768
Window or config flag: borderless windowed mode.

FLAG_MSAA_4X_HINT

const FLAG_MSAA_4X_HINT: u32 = 32
Window or config flag: msaa 4x hint.

FLAG_INTERLACED_HINT

const FLAG_INTERLACED_HINT: u32 = 65536
Window or config flag: interlaced hint.

LOG_ALL

const LOG_ALL: i32 = 0
Log level: all.

LOG_TRACE

const LOG_TRACE: i32 = 1
Log level: trace.

LOG_DEBUG

const LOG_DEBUG: i32 = 2
Log level: debug.

LOG_INFO

const LOG_INFO: i32 = 3
Log level: info.

LOG_WARNING

const LOG_WARNING: i32 = 4
Log level: warning.

LOG_ERROR

const LOG_ERROR: i32 = 5
Log level: error.

LOG_FATAL

const LOG_FATAL: i32 = 6
Log level: fatal.

LOG_NONE

const LOG_NONE: i32 = 7
Log level: none.

MOUSE_BUTTON_LEFT

const MOUSE_BUTTON_LEFT: i32 = 0
Mouse: button left.

MOUSE_BUTTON_RIGHT

const MOUSE_BUTTON_RIGHT: i32 = 1
Mouse: button right.

MOUSE_BUTTON_MIDDLE

const MOUSE_BUTTON_MIDDLE: i32 = 2
Mouse: button middle.

MOUSE_BUTTON_SIDE

const MOUSE_BUTTON_SIDE: i32 = 3
Mouse: button side.

MOUSE_BUTTON_EXTRA

const MOUSE_BUTTON_EXTRA: i32 = 4
Mouse: button extra.

MOUSE_BUTTON_FORWARD

const MOUSE_BUTTON_FORWARD: i32 = 5
Mouse: button forward.

MOUSE_BUTTON_BACK

const MOUSE_BUTTON_BACK: i32 = 6
Mouse: button back.

MOUSE_CURSOR_DEFAULT

const MOUSE_CURSOR_DEFAULT: i32 = 0
Mouse: cursor default.

MOUSE_CURSOR_ARROW

const MOUSE_CURSOR_ARROW: i32 = 1
Mouse: cursor arrow.

MOUSE_CURSOR_IBEAM

const MOUSE_CURSOR_IBEAM: i32 = 2
Mouse: cursor ibeam.

MOUSE_CURSOR_CROSSHAIR

const MOUSE_CURSOR_CROSSHAIR: i32 = 3
Mouse: cursor crosshair.

MOUSE_CURSOR_POINTING_HAND

const MOUSE_CURSOR_POINTING_HAND: i32 = 4
Mouse: cursor pointing hand.

MOUSE_CURSOR_RESIZE_EW

const MOUSE_CURSOR_RESIZE_EW: i32 = 5
Mouse: cursor resize ew.

MOUSE_CURSOR_RESIZE_NS

const MOUSE_CURSOR_RESIZE_NS: i32 = 6
Mouse: cursor resize ns.

MOUSE_CURSOR_RESIZE_NWSE

const MOUSE_CURSOR_RESIZE_NWSE: i32 = 7
Mouse: cursor resize nwse.

MOUSE_CURSOR_RESIZE_NESW

const MOUSE_CURSOR_RESIZE_NESW: i32 = 8
Mouse: cursor resize nesw.

MOUSE_CURSOR_RESIZE_ALL

const MOUSE_CURSOR_RESIZE_ALL: i32 = 9
Mouse: cursor resize all.

MOUSE_CURSOR_NOT_ALLOWED

const MOUSE_CURSOR_NOT_ALLOWED: i32 = 10
Mouse: cursor not allowed.

GAMEPAD_BUTTON_UNKNOWN

const GAMEPAD_BUTTON_UNKNOWN: i32 = 0
Gamepad: button unknown.

GAMEPAD_BUTTON_LEFT_FACE_UP

const GAMEPAD_BUTTON_LEFT_FACE_UP: i32 = 1
Gamepad: button left face up.

GAMEPAD_BUTTON_LEFT_FACE_RIGHT

const GAMEPAD_BUTTON_LEFT_FACE_RIGHT: i32 = 2
Gamepad: button left face right.

GAMEPAD_BUTTON_LEFT_FACE_DOWN

const GAMEPAD_BUTTON_LEFT_FACE_DOWN: i32 = 3
Gamepad: button left face down.

GAMEPAD_BUTTON_LEFT_FACE_LEFT

const GAMEPAD_BUTTON_LEFT_FACE_LEFT: i32 = 4
Gamepad: button left face left.

GAMEPAD_BUTTON_RIGHT_FACE_UP

const GAMEPAD_BUTTON_RIGHT_FACE_UP: i32 = 5
Gamepad: button right face up.

GAMEPAD_BUTTON_RIGHT_FACE_RIGHT

const GAMEPAD_BUTTON_RIGHT_FACE_RIGHT: i32 = 6
Gamepad: button right face right.

GAMEPAD_BUTTON_RIGHT_FACE_DOWN

const GAMEPAD_BUTTON_RIGHT_FACE_DOWN: i32 = 7
Gamepad: button right face down.

GAMEPAD_BUTTON_RIGHT_FACE_LEFT

const GAMEPAD_BUTTON_RIGHT_FACE_LEFT: i32 = 8
Gamepad: button right face left.

GAMEPAD_BUTTON_LEFT_TRIGGER_1

const GAMEPAD_BUTTON_LEFT_TRIGGER_1: i32 = 9
Gamepad: button left trigger 1.

GAMEPAD_BUTTON_LEFT_TRIGGER_2

const GAMEPAD_BUTTON_LEFT_TRIGGER_2: i32 = 10
Gamepad: button left trigger 2.

GAMEPAD_BUTTON_RIGHT_TRIGGER_1

const GAMEPAD_BUTTON_RIGHT_TRIGGER_1: i32 = 11
Gamepad: button right trigger 1.

GAMEPAD_BUTTON_RIGHT_TRIGGER_2

const GAMEPAD_BUTTON_RIGHT_TRIGGER_2: i32 = 12
Gamepad: button right trigger 2.

GAMEPAD_BUTTON_MIDDLE_LEFT

const GAMEPAD_BUTTON_MIDDLE_LEFT: i32 = 13
Gamepad: button middle left.

GAMEPAD_BUTTON_MIDDLE

const GAMEPAD_BUTTON_MIDDLE: i32 = 14
Gamepad: button middle.

GAMEPAD_BUTTON_MIDDLE_RIGHT

const GAMEPAD_BUTTON_MIDDLE_RIGHT: i32 = 15
Gamepad: button middle right.

GAMEPAD_BUTTON_LEFT_THUMB

const GAMEPAD_BUTTON_LEFT_THUMB: i32 = 16
Gamepad: button left thumb.

GAMEPAD_BUTTON_RIGHT_THUMB

const GAMEPAD_BUTTON_RIGHT_THUMB: i32 = 17
Gamepad: button right thumb.

GAMEPAD_AXIS_LEFT_X

const GAMEPAD_AXIS_LEFT_X: i32 = 0
Gamepad: axis left x.

GAMEPAD_AXIS_LEFT_Y

const GAMEPAD_AXIS_LEFT_Y: i32 = 1
Gamepad: axis left y.

GAMEPAD_AXIS_RIGHT_X

const GAMEPAD_AXIS_RIGHT_X: i32 = 2
Gamepad: axis right x.

GAMEPAD_AXIS_RIGHT_Y

const GAMEPAD_AXIS_RIGHT_Y: i32 = 3
Gamepad: axis right y.

GAMEPAD_AXIS_LEFT_TRIGGER

const GAMEPAD_AXIS_LEFT_TRIGGER: i32 = 4
Gamepad: axis left trigger.

GAMEPAD_AXIS_RIGHT_TRIGGER

const GAMEPAD_AXIS_RIGHT_TRIGGER: i32 = 5
Gamepad: axis right trigger.

BLEND_ALPHA

const BLEND_ALPHA: i32 = 0
Blend mode: alpha.

BLEND_ADDITIVE

const BLEND_ADDITIVE: i32 = 1
Blend mode: additive.

BLEND_MULTIPLIED

const BLEND_MULTIPLIED: i32 = 2
Blend mode: multiplied.

BLEND_ADD_COLORS

const BLEND_ADD_COLORS: i32 = 3
Blend mode: add colors.

BLEND_SUBTRACT_COLORS

const BLEND_SUBTRACT_COLORS: i32 = 4
Blend mode: subtract colors.

BLEND_ALPHA_PREMULTIPLY

const BLEND_ALPHA_PREMULTIPLY: i32 = 5
Blend mode: alpha premultiply.

BLEND_CUSTOM

const BLEND_CUSTOM: i32 = 6
Blend mode: custom.

TEXTURE_FILTER_POINT

const TEXTURE_FILTER_POINT: i32 = 0
Texture option: filter point.

TEXTURE_FILTER_BILINEAR

const TEXTURE_FILTER_BILINEAR: i32 = 1
Texture option: filter bilinear.

TEXTURE_FILTER_TRILINEAR

const TEXTURE_FILTER_TRILINEAR: i32 = 2
Texture option: filter trilinear.

TEXTURE_FILTER_ANISOTROPIC_4X

const TEXTURE_FILTER_ANISOTROPIC_4X: i32 = 3
Texture option: filter anisotropic 4x.

TEXTURE_FILTER_ANISOTROPIC_8X

const TEXTURE_FILTER_ANISOTROPIC_8X: i32 = 4
Texture option: filter anisotropic 8x.

TEXTURE_FILTER_ANISOTROPIC_16X

const TEXTURE_FILTER_ANISOTROPIC_16X: i32 = 5
Texture option: filter anisotropic 16x.

TEXTURE_WRAP_REPEAT

const TEXTURE_WRAP_REPEAT: i32 = 0
Texture option: wrap repeat.

TEXTURE_WRAP_CLAMP

const TEXTURE_WRAP_CLAMP: i32 = 1
Texture option: wrap clamp.

TEXTURE_WRAP_MIRROR_REPEAT

const TEXTURE_WRAP_MIRROR_REPEAT: i32 = 2
Texture option: wrap mirror repeat.

TEXTURE_WRAP_MIRROR_CLAMP

const TEXTURE_WRAP_MIRROR_CLAMP: i32 = 3
Texture option: wrap mirror clamp.

CAMERA_CUSTOM

const CAMERA_CUSTOM: i32 = 0
Camera setting: custom.

CAMERA_FREE

const CAMERA_FREE: i32 = 1
Camera setting: free.

CAMERA_ORBITAL

const CAMERA_ORBITAL: i32 = 2
Camera setting: orbital.

CAMERA_FIRST_PERSON

const CAMERA_FIRST_PERSON: i32 = 3
Camera setting: first person.

CAMERA_THIRD_PERSON

const CAMERA_THIRD_PERSON: i32 = 4
Camera setting: third person.

CAMERA_PERSPECTIVE

const CAMERA_PERSPECTIVE: i32 = 0
Camera setting: perspective.

CAMERA_ORTHOGRAPHIC

const CAMERA_ORTHOGRAPHIC: i32 = 1
Camera setting: orthographic.

PIXELFORMAT_UNCOMPRESSED_GRAYSCALE

const PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: i32 = 1
Pixel format: uncompressed grayscale.

PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA

const PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: i32 = 2
Pixel format: uncompressed gray alpha.

PIXELFORMAT_UNCOMPRESSED_R5G6B5

const PIXELFORMAT_UNCOMPRESSED_R5G6B5: i32 = 3
Pixel format: uncompressed r5g6b5.

PIXELFORMAT_UNCOMPRESSED_R8G8B8

const PIXELFORMAT_UNCOMPRESSED_R8G8B8: i32 = 4
Pixel format: uncompressed r8g8b8.

PIXELFORMAT_UNCOMPRESSED_R5G5B5A1

const PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: i32 = 5
Pixel format: uncompressed r5g5b5a1.

PIXELFORMAT_UNCOMPRESSED_R4G4B4A4

const PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: i32 = 6
Pixel format: uncompressed r4g4b4a4.

PIXELFORMAT_UNCOMPRESSED_R8G8B8A8

const PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: i32 = 7
Pixel format: uncompressed r8g8b8a8.

PIXELFORMAT_UNCOMPRESSED_R32

const PIXELFORMAT_UNCOMPRESSED_R32: i32 = 8
Pixel format: uncompressed r32.

PIXELFORMAT_UNCOMPRESSED_R32G32B32

const PIXELFORMAT_UNCOMPRESSED_R32G32B32: i32 = 9
Pixel format: uncompressed r32g32b32.

PIXELFORMAT_UNCOMPRESSED_R32G32B32A32

const PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: i32 = 10
Pixel format: uncompressed r32g32b32a32.

SHADER_UNIFORM_FLOAT

const SHADER_UNIFORM_FLOAT: i32 = 0
Shader uniform type: uniform float.

SHADER_UNIFORM_VEC2

const SHADER_UNIFORM_VEC2: i32 = 1
Shader uniform type: uniform vec2.

SHADER_UNIFORM_VEC3

const SHADER_UNIFORM_VEC3: i32 = 2
Shader uniform type: uniform vec3.

SHADER_UNIFORM_VEC4

const SHADER_UNIFORM_VEC4: i32 = 3
Shader uniform type: uniform vec4.

SHADER_UNIFORM_INT

const SHADER_UNIFORM_INT: i32 = 4
Shader uniform type: uniform int.

SHADER_UNIFORM_SAMPLER2D

const SHADER_UNIFORM_SAMPLER2D: i32 = 8
Shader uniform type: uniform sampler2d.

MATERIAL_MAP_ALBEDO

const MATERIAL_MAP_ALBEDO: i32 = 0
Material map slot: map albedo.

MATERIAL_MAP_METALNESS

const MATERIAL_MAP_METALNESS: i32 = 1
Material map slot: map metalness.

MATERIAL_MAP_NORMAL

const MATERIAL_MAP_NORMAL: i32 = 2
Material map slot: map normal.

MATERIAL_MAP_ROUGHNESS

const MATERIAL_MAP_ROUGHNESS: i32 = 3
Material map slot: map roughness.

MATERIAL_MAP_OCCLUSION

const MATERIAL_MAP_OCCLUSION: i32 = 4
Material map slot: map occlusion.

MATERIAL_MAP_EMISSION

const MATERIAL_MAP_EMISSION: i32 = 5
Material map slot: map emission.

GESTURE_NONE

const GESTURE_NONE: u32 = 0
Touch gesture: none.

GESTURE_TAP

const GESTURE_TAP: u32 = 1
Touch gesture: tap.

GESTURE_DOUBLETAP

const GESTURE_DOUBLETAP: u32 = 2
Touch gesture: doubletap.

GESTURE_HOLD

const GESTURE_HOLD: u32 = 4
Touch gesture: hold.

GESTURE_DRAG

const GESTURE_DRAG: u32 = 8
Touch gesture: drag.

GESTURE_SWIPE_RIGHT

const GESTURE_SWIPE_RIGHT: u32 = 16
Touch gesture: swipe right.

GESTURE_SWIPE_LEFT

const GESTURE_SWIPE_LEFT: u32 = 32
Touch gesture: swipe left.

GESTURE_SWIPE_UP

const GESTURE_SWIPE_UP: u32 = 64
Touch gesture: swipe up.

GESTURE_SWIPE_DOWN

const GESTURE_SWIPE_DOWN: u32 = 128
Touch gesture: swipe down.

GESTURE_PINCH_IN

const GESTURE_PINCH_IN: u32 = 256
Touch gesture: pinch in.

GESTURE_PINCH_OUT

const GESTURE_PINCH_OUT: u32 = 512
Touch gesture: pinch out.

Functions

GetFontDefault

func GetFontDefault(): Font
Returns font default.

LoadFont

func LoadFont(fileName: str): Font
Loads font and returns it.

LoadFontEx

func LoadFontEx(fileName: str, fontSize: int, codepoints: int*, codepointCount: int): Font
Loads font and returns it.

LoadFontFromImage

func LoadFontFromImage(image: Image, key: Color, firstChar: int): Font
Loads font from image and returns it.

IsFontValid

func IsFontValid(font: Font): bool
Returns true when the font loaded correctly.

UnloadFont

func UnloadFont(font: Font)
Frees a loaded font.

DrawFPS

func DrawFPS(posX: int, posY: int)
Draws FPS.

DrawText

func DrawText(text: str, posX: int, posY: int, fontSize: int, color: Color)
Draws text.

DrawTextEx

func DrawTextEx(font: Font, text: str, position: Vector2, fontSize: f32, spacing: f32, tint: Color)
Draws text.

DrawTextPro

func DrawTextPro(font: Font, text: str, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color)
Draws text.

DrawTextCodepoint

func DrawTextCodepoint(font: Font, codepoint: int, position: Vector2, fontSize: f32, tint: Color)
Draws text codepoint.

SetTextLineSpacing

func SetTextLineSpacing(spacing: int)
Sets text line spacing.

MeasureText

func MeasureText(text: str, fontSize: int): int
Measure text.

MeasureTextEx

func MeasureTextEx(font: Font, text: str, fontSize: f32, spacing: f32): Vector2
Measure text.

GetGlyphIndex

func GetGlyphIndex(font: Font, codepoint: int): int
Returns glyph index.

TextLength

func TextLength(text: str): u32
Text length.

TextIsEqual

func TextIsEqual(text1: str, text2: str): bool
Text is equal.

TextSubtext

func TextSubtext(text: str, position: int, length: int): str
Text subtext.

TextReplace

func TextReplace(text: str, search: str, replacement: str): str
Text replace.

TextFindIndex

func TextFindIndex(text: str, find: str): int
Text find index.

TextToUpper

func TextToUpper(text: str): str
Text to upper.

TextToLower

func TextToLower(text: str): str
Text to lower.

TextToPascal

func TextToPascal(text: str): str
Text to pascal.

TextToSnake

func TextToSnake(text: str): str
Text to snake.

TextToCamel

func TextToCamel(text: str): str
Text to camel.

TextToInteger

func TextToInteger(text: str): int
Text to integer.

DrawTextEx

func DrawTextEx(font: Font, text: str, position: Vector2, fontSize: f64, spacing: f64, tint: Color)
Draws text.

DrawTextPro

func DrawTextPro(font: Font, text: str, position: Vector2, origin: Vector2, rotation: f64, fontSize: f64, spacing: f64, tint: Color)
Draws text.

DrawTextCodepoint

func DrawTextCodepoint(font: Font, codepoint: int, position: Vector2, fontSize: f64, tint: Color)
Draws text codepoint.

MeasureTextEx

func MeasureTextEx(font: Font, text: str, fontSize: f64, spacing: f64): Vector2
Measure text.

InitAudioDevice

func InitAudioDevice()
Init audio device.

CloseAudioDevice

func CloseAudioDevice()
Close audio device.

IsAudioDeviceReady

func IsAudioDeviceReady(): bool
Returns true when audio device ready holds.

SetMasterVolume

func SetMasterVolume(volume: f32)
Sets master volume.

GetMasterVolume

func GetMasterVolume(): f32
Returns master volume.

LoadWave

func LoadWave(fileName: str): Wave
Loads wave and returns it.

IsWaveValid

func IsWaveValid(wave: Wave): bool
Returns true when the wave loaded correctly.

LoadSound

func LoadSound(fileName: str): Sound
Loads sound and returns it.

LoadSoundFromWave

func LoadSoundFromWave(wave: Wave): Sound
Loads sound from wave and returns it.

LoadSoundAlias

func LoadSoundAlias(source: Sound): Sound
Loads sound alias and returns it.

IsSoundValid

func IsSoundValid(sound: Sound): bool
Returns true when the sound loaded correctly.

UpdateSound

func UpdateSound(sound: Sound, data: void*, sampleCount: int)
Updates sound.

UnloadWave

func UnloadWave(wave: Wave)
Frees a loaded wave.

UnloadSound

func UnloadSound(sound: Sound)
Frees a loaded sound.

UnloadSoundAlias

func UnloadSoundAlias(alias: Sound)
Frees a loaded sound alias.

ExportWave

func ExportWave(wave: Wave, fileName: str): bool
Export wave.

PlaySound

func PlaySound(sound: Sound)
Play sound.
gui-raylib-PlaySound.salam
import gui.raylib

func main:
    raylib.InitWindow(400, 300, "Sound")
    raylib.InitAudioDevice()
    beep := raylib.LoadSound("beep.wav")
    until not raylib.WindowShouldClose():
        if raylib.IsKeyPressed(raylib.KEY_SPACE):
            raylib.PlaySound(beep)
        end
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawText("Press space", 130, 140, 24, raylib.DarkGray())
        raylib.EndDrawing()
    end
    raylib.UnloadSound(beep)
    raylib.CloseAudioDevice()
    raylib.CloseWindow()
end

StopSound

func StopSound(sound: Sound)
Stop sound.

PauseSound

func PauseSound(sound: Sound)
Pause sound.

ResumeSound

func ResumeSound(sound: Sound)
Resume sound.

IsSoundPlaying

func IsSoundPlaying(sound: Sound): bool
Returns true when sound playing holds.

SetSoundVolume

func SetSoundVolume(sound: Sound, volume: f32)
Sets sound volume.

SetSoundPitch

func SetSoundPitch(sound: Sound, pitch: f32)
Sets sound pitch.

SetSoundPan

func SetSoundPan(sound: Sound, pan: f32)
Sets sound pan.

WaveCopy

func WaveCopy(wave: Wave): Wave
Wave copy.

WaveCrop

func WaveCrop(wave &: Wave, initFrame: int, finalFrame: int)
Wave crop.

WaveFormat

func WaveFormat(wave &: Wave, sampleRate: int, sampleSize: int, channels: int)
Wave format.

LoadWaveSamples

func LoadWaveSamples(wave: Wave): f32*
Loads wave samples and returns it.

UnloadWaveSamples

func UnloadWaveSamples(samples: f32*)
Frees a loaded wave samples.

LoadMusicStream

func LoadMusicStream(fileName: str): Music
Loads music stream and returns it.

IsMusicValid

func IsMusicValid(music: Music): bool
Returns true when the music loaded correctly.

UnloadMusicStream

func UnloadMusicStream(music: Music)
Frees a loaded music stream.

PlayMusicStream

func PlayMusicStream(music: Music)
Play music stream.

IsMusicStreamPlaying

func IsMusicStreamPlaying(music: Music): bool
Returns true when music stream playing holds.

UpdateMusicStream

func UpdateMusicStream(music: Music)
Updates music stream.

StopMusicStream

func StopMusicStream(music: Music)
Stop music stream.

PauseMusicStream

func PauseMusicStream(music: Music)
Pause music stream.

ResumeMusicStream

func ResumeMusicStream(music: Music)
Resume music stream.

SeekMusicStream

func SeekMusicStream(music: Music, position: f32)
Seek music stream.

SetMusicVolume

func SetMusicVolume(music: Music, volume: f32)
Sets music volume.

SetMusicPitch

func SetMusicPitch(music: Music, pitch: f32)
Sets music pitch.

SetMusicPan

func SetMusicPan(music: Music, pan: f32)
Sets music pan.

GetMusicTimeLength

func GetMusicTimeLength(music: Music): f32
Returns music time length.

GetMusicTimePlayed

func GetMusicTimePlayed(music: Music): f32
Returns music time played.

SetMasterVolume

func SetMasterVolume(volume: f64)
Sets master volume.

SetSoundVolume

func SetSoundVolume(sound: Sound, volume: f64)
Sets sound volume.

SetSoundPitch

func SetSoundPitch(sound: Sound, pitch: f64)
Sets sound pitch.

SetSoundPan

func SetSoundPan(sound: Sound, pan: f64)
Sets sound pan.

SeekMusicStream

func SeekMusicStream(music: Music, position: f64)
Seek music stream.

SetMusicVolume

func SetMusicVolume(music: Music, volume: f64)
Sets music volume.

SetMusicPitch

func SetMusicPitch(music: Music, pitch: f64)
Sets music pitch.

SetMusicPan

func SetMusicPan(music: Music, pan: f64)
Sets music pan.

IsKeyPressed

func IsKeyPressed(key: int): bool
Returns true when the key is pressed this frame.

IsKeyPressedRepeat

func IsKeyPressedRepeat(key: int): bool
Returns true when the key is pressed again by key repeat.

IsKeyDown

func IsKeyDown(key: int): bool
Returns true when the key is held down.
gui-raylib-IsKeyDown.salam
import gui.raylib

func main:
    raylib.InitWindow(400, 300, "Keys")
    mut x := 200
    until not raylib.WindowShouldClose():
        if raylib.IsKeyDown(raylib.KEY_RIGHT): x += 3 end
        if raylib.IsKeyDown(raylib.KEY_LEFT): x -= 3 end
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawCircle(x, 150, 20.0, raylib.Maroon())
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

IsKeyReleased

func IsKeyReleased(key: int): bool
Returns true when the key is released this frame.

IsKeyUp

func IsKeyUp(key: int): bool
Returns true when the key is not held.

GetKeyPressed

func GetKeyPressed(): int
Returns key pressed.

GetCharPressed

func GetCharPressed(): int
Returns char pressed.

SetExitKey

func SetExitKey(key: int)
Sets exit key.

IsGamepadAvailable

func IsGamepadAvailable(gamepad: int): bool
Returns true when gamepad available holds.

GetGamepadName

func GetGamepadName(gamepad: int): str
Returns gamepad name.

IsGamepadButtonPressed

func IsGamepadButtonPressed(gamepad: int, button: int): bool
Returns true when the gamepad button is pressed this frame.

IsGamepadButtonDown

func IsGamepadButtonDown(gamepad: int, button: int): bool
Returns true when the gamepad button is held down.

IsGamepadButtonReleased

func IsGamepadButtonReleased(gamepad: int, button: int): bool
Returns true when the gamepad button is released this frame.

IsGamepadButtonUp

func IsGamepadButtonUp(gamepad: int, button: int): bool
Returns true when the gamepad button is not held.

GetGamepadButtonPressed

func GetGamepadButtonPressed(): int
Returns gamepad button pressed.

GetGamepadAxisCount

func GetGamepadAxisCount(gamepad: int): int
Returns gamepad axis count.

GetGamepadAxisMovement

func GetGamepadAxisMovement(gamepad: int, axis: int): f32
Returns gamepad axis movement.

SetGamepadMappings

func SetGamepadMappings(mappings: str): int
Sets gamepad mappings.

SetGamepadVibration

func SetGamepadVibration(gamepad: int, leftMotor: f32, rightMotor: f32, duration: f32)
Sets gamepad vibration.

IsMouseButtonPressed

func IsMouseButtonPressed(button: int): bool
Returns true when the mouse button is pressed this frame.

IsMouseButtonDown

func IsMouseButtonDown(button: int): bool
Returns true when the mouse button is held down.

IsMouseButtonReleased

func IsMouseButtonReleased(button: int): bool
Returns true when the mouse button is released this frame.

IsMouseButtonUp

func IsMouseButtonUp(button: int): bool
Returns true when the mouse button is not held.

GetMouseX

func GetMouseX(): int
Returns mouse x.

GetMouseY

func GetMouseY(): int
Returns mouse y.

GetMousePosition

func GetMousePosition(): Vector2
Returns mouse position.

GetMouseDelta

func GetMouseDelta(): Vector2
Returns mouse delta.

SetMousePosition

func SetMousePosition(x: int, y: int)
Sets mouse position.

SetMouseOffset

func SetMouseOffset(offsetX: int, offsetY: int)
Sets mouse offset.

SetMouseScale

func SetMouseScale(scaleX: f32, scaleY: f32)
Sets mouse scale.

GetMouseWheelMove

func GetMouseWheelMove(): f32
Returns mouse wheel move.

GetMouseWheelMoveV

func GetMouseWheelMoveV(): Vector2
Returns mouse wheel move.

SetMouseCursor

func SetMouseCursor(cursor: int)
Sets mouse cursor.

GetTouchX

func GetTouchX(): int
Returns touch x.

GetTouchY

func GetTouchY(): int
Returns touch y.

GetTouchPosition

func GetTouchPosition(index: int): Vector2
Returns touch position.

GetTouchPointId

func GetTouchPointId(index: int): int
Returns touch point id.

GetTouchPointCount

func GetTouchPointCount(): int
Returns touch point count.

SetGesturesEnabled

func SetGesturesEnabled(flags: u32)
Sets gestures enabled.

IsGestureDetected

func IsGestureDetected(gesture: u32): bool
Returns true when gesture detected holds.

GetGestureDetected

func GetGestureDetected(): int
Returns gesture detected.

GetGestureHoldDuration

func GetGestureHoldDuration(): f32
Returns gesture hold duration.

GetGestureDragVector

func GetGestureDragVector(): Vector2
Returns gesture drag vector.

GetGestureDragAngle

func GetGestureDragAngle(): f32
Returns gesture drag angle.

GetGesturePinchVector

func GetGesturePinchVector(): Vector2
Returns gesture pinch vector.

GetGesturePinchAngle

func GetGesturePinchAngle(): f32
Returns gesture pinch angle.

UpdateCamera

func UpdateCamera(camera &: Camera3D, mode: int)
Updates camera.

UpdateCameraPro

func UpdateCameraPro(camera &: Camera3D, movement: Vector3, rotation: Vector3, zoom: f32)
Updates camera.

SetGamepadVibration

func SetGamepadVibration(gamepad: int, leftMotor: f64, rightMotor: f64, duration: f64)
Sets gamepad vibration.

SetMouseScale

func SetMouseScale(scaleX: f64, scaleY: f64)
Sets mouse scale.

UpdateCameraPro

func UpdateCameraPro(camera &: Camera3D, movement: Vector3, rotation: Vector3, zoom: f64)
Updates camera.

InitWindow

func InitWindow(width: int, height: int, title: str)
Init window.
gui-raylib-InitWindow.salam
import gui.raylib

func main:
    raylib.InitWindow(640, 360, "Hello Salam")
    raylib.SetTargetFPS(60)
    until not raylib.WindowShouldClose():
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawText("Hello from Salam", 190, 170, 30, raylib.DarkGray())
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

CloseWindow

func CloseWindow()
Close window.

WindowShouldClose

func WindowShouldClose(): bool
Window should close.

IsWindowReady

func IsWindowReady(): bool
Returns true when the window is ready.

IsWindowFullscreen

func IsWindowFullscreen(): bool
Returns true when the window is fullscreen.

IsWindowHidden

func IsWindowHidden(): bool
Returns true when the window is hidden.

IsWindowMinimized

func IsWindowMinimized(): bool
Returns true when the window is minimized.

IsWindowMaximized

func IsWindowMaximized(): bool
Returns true when the window is maximized.

IsWindowFocused

func IsWindowFocused(): bool
Returns true when the window is focused.

IsWindowResized

func IsWindowResized(): bool
Returns true when the window is resized.

IsWindowState

func IsWindowState(flag: u32): bool
Returns true when the window has the given state flag.

SetWindowState

func SetWindowState(flags: u32)
Turns on window state flags.

ClearWindowState

func ClearWindowState(flags: u32)
Turns off window state flags.

ToggleFullscreen

func ToggleFullscreen()
Toggle fullscreen.

ToggleBorderlessWindowed

func ToggleBorderlessWindowed()
Toggle borderless windowed.

MaximizeWindow

func MaximizeWindow()
Maximize window.

MinimizeWindow

func MinimizeWindow()
Minimize window.

RestoreWindow

func RestoreWindow()
Restore window.

SetWindowIcon

func SetWindowIcon(image: Image)
Sets window icon.

SetWindowTitle

func SetWindowTitle(title: str)
Sets window title.

SetWindowPosition

func SetWindowPosition(x: int, y: int)
Sets window position.

SetWindowMonitor

func SetWindowMonitor(monitor: int)
Sets window monitor.

SetWindowMinSize

func SetWindowMinSize(width: int, height: int)
Sets window min size.

SetWindowMaxSize

func SetWindowMaxSize(width: int, height: int)
Sets window max size.

SetWindowSize

func SetWindowSize(width: int, height: int)
Sets window size.

SetWindowOpacity

func SetWindowOpacity(opacity: f32)
Sets window opacity.

SetWindowFocused

func SetWindowFocused()
Sets window focused.

GetScreenWidth

func GetScreenWidth(): int
Returns screen width.

GetScreenHeight

func GetScreenHeight(): int
Returns screen height.

GetRenderWidth

func GetRenderWidth(): int
Returns render width.

GetRenderHeight

func GetRenderHeight(): int
Returns render height.

GetMonitorCount

func GetMonitorCount(): int
Returns monitor count.

GetCurrentMonitor

func GetCurrentMonitor(): int
Returns current monitor.

GetMonitorPosition

func GetMonitorPosition(monitor: int): Vector2
Returns monitor position.

GetMonitorWidth

func GetMonitorWidth(monitor: int): int
Returns monitor width.

GetMonitorHeight

func GetMonitorHeight(monitor: int): int
Returns monitor height.

GetMonitorPhysicalWidth

func GetMonitorPhysicalWidth(monitor: int): int
Returns monitor physical width.

GetMonitorPhysicalHeight

func GetMonitorPhysicalHeight(monitor: int): int
Returns monitor physical height.

GetMonitorRefreshRate

func GetMonitorRefreshRate(monitor: int): int
Returns monitor refresh rate.

GetWindowPosition

func GetWindowPosition(): Vector2
Returns window position.

GetWindowScaleDPI

func GetWindowScaleDPI(): Vector2
Returns window scale DPI.

GetMonitorName

func GetMonitorName(monitor: int): str
Returns monitor name.

SetClipboardText

func SetClipboardText(text: str)
Sets clipboard text.

GetClipboardText

func GetClipboardText(): str
Returns clipboard text.

EnableEventWaiting

func EnableEventWaiting()
Enable event waiting.

DisableEventWaiting

func DisableEventWaiting()
Disable event waiting.

ShowCursor

func ShowCursor()
Show cursor.

HideCursor

func HideCursor()
Hide cursor.

IsCursorHidden

func IsCursorHidden(): bool
Returns true when cursor hidden holds.

EnableCursor

func EnableCursor()
Enable cursor.

DisableCursor

func DisableCursor()
Disable cursor.

IsCursorOnScreen

func IsCursorOnScreen(): bool
Returns true when cursor on screen holds.

ClearBackground

func ClearBackground(color: Color)
Clear background.

BeginDrawing

func BeginDrawing()
Starts drawing mode; end it with the matching End call.

EndDrawing

func EndDrawing()
Ends drawing mode.

BeginMode2D

func BeginMode2D(camera: Camera2D)
Starts 2D mode; end it with the matching End call.

EndMode2D

func EndMode2D()
Ends 2D mode.

BeginMode3D

func BeginMode3D(camera: Camera3D)
Starts 3D mode; end it with the matching End call.

EndMode3D

func EndMode3D()
Ends 3D mode.

BeginTextureMode

func BeginTextureMode(target: RenderTexture)
Starts texture mode; end it with the matching End call.

EndTextureMode

func EndTextureMode()
Ends texture mode.

BeginShaderMode

func BeginShaderMode(shader: Shader)
Starts shader mode; end it with the matching End call.

EndShaderMode

func EndShaderMode()
Ends shader mode.

BeginBlendMode

func BeginBlendMode(mode: int)
Starts blend mode; end it with the matching End call.

EndBlendMode

func EndBlendMode()
Ends blend mode.

BeginScissorMode

func BeginScissorMode(x: int, y: int, width: int, height: int)
Starts scissor mode; end it with the matching End call.

EndScissorMode

func EndScissorMode()
Ends scissor mode.

LoadShader

func LoadShader(vsFileName: str, fsFileName: str): Shader
Loads shader and returns it.

LoadShaderFromMemory

func LoadShaderFromMemory(vsCode: str, fsCode: str): Shader
Loads shader from memory and returns it.

IsShaderValid

func IsShaderValid(shader: Shader): bool
Returns true when the shader loaded correctly.

GetShaderLocation

func GetShaderLocation(shader: Shader, uniformName: str): int
Returns shader location.

GetShaderLocationAttrib

func GetShaderLocationAttrib(shader: Shader, attribName: str): int
Returns shader location attrib.

SetShaderValue

func SetShaderValue(shader: Shader, locIndex: int, value: void*, uniformType: int)
Sets shader value.

SetShaderValueV

func SetShaderValueV(shader: Shader, locIndex: int, value: void*, uniformType: int, count: int)
Sets shader value.

SetShaderValueMatrix

func SetShaderValueMatrix(shader: Shader, locIndex: int, mat: Matrix)
Sets shader value matrix.

SetShaderValueTexture

func SetShaderValueTexture(shader: Shader, locIndex: int, texture: Texture)
Sets shader value texture.

UnloadShader

func UnloadShader(shader: Shader)
Frees a loaded shader.

GetScreenToWorldRay

func GetScreenToWorldRay(position: Vector2, camera: Camera3D): Ray
Returns screen to world ray.

GetScreenToWorldRayEx

func GetScreenToWorldRayEx(position: Vector2, camera: Camera3D, width: int, height: int): Ray
Returns screen to world ray.

GetWorldToScreen

func GetWorldToScreen(position: Vector3, camera: Camera3D): Vector2
Returns world to screen.

GetWorldToScreenEx

func GetWorldToScreenEx(position: Vector3, camera: Camera3D, width: int, height: int): Vector2
Returns world to screen.

GetWorldToScreen2D

func GetWorldToScreen2D(position: Vector2, camera: Camera2D): Vector2
Returns world to screen 2D.

GetScreenToWorld2D

func GetScreenToWorld2D(position: Vector2, camera: Camera2D): Vector2
Returns screen to world 2D.

GetCameraMatrix

func GetCameraMatrix(camera: Camera3D): Matrix
Returns camera matrix.

GetCameraMatrix2D

func GetCameraMatrix2D(camera: Camera2D): Matrix
Returns camera matrix 2D.

SetTargetFPS

func SetTargetFPS(fps: int)
Sets target FPS.

GetFrameTime

func GetFrameTime(): f32
Returns frame time.

GetTime

func GetTime(): f64
Returns time.

GetFPS

func GetFPS(): int
Returns FPS.

SwapScreenBuffer

func SwapScreenBuffer()
Swap screen buffer.

PollInputEvents

func PollInputEvents()
Poll input events.

WaitTime

func WaitTime(seconds: f64)
Wait time.

SetRandomSeed

func SetRandomSeed(seed: u32)
Sets random seed.

GetRandomValue

func GetRandomValue(min: int, max: int): int
Returns random value.

TakeScreenshot

func TakeScreenshot(fileName: str)
Take screenshot.

SetConfigFlags

func SetConfigFlags(flags: u32)
Sets config flags.

OpenURL

func OpenURL(url: str)
Open URL.

SetTraceLogLevel

func SetTraceLogLevel(logLevel: int)
Sets trace log level.

MemAlloc

func MemAlloc(size: u32): void*
Mem alloc.

MemFree

func MemFree(ptr: void*)
Mem free.

FileExists

func FileExists(fileName: str): bool
File exists.

DirectoryExists

func DirectoryExists(dirPath: str): bool
Directory exists.

IsFileExtension

func IsFileExtension(fileName: str, ext: str): bool
Returns true when file extension holds.

GetFileLength

func GetFileLength(fileName: str): int
Returns file length.

GetFileExtension

func GetFileExtension(fileName: str): str
Returns file extension.

GetFileName

func GetFileName(filePath: str): str
Returns file name.

GetFileNameWithoutExt

func GetFileNameWithoutExt(filePath: str): str
Returns file name without ext.

GetDirectoryPath

func GetDirectoryPath(filePath: str): str
Returns directory path.

GetPrevDirectoryPath

func GetPrevDirectoryPath(dirPath: str): str
Returns prev directory path.

GetWorkingDirectory

func GetWorkingDirectory(): str
Returns working directory.

GetApplicationDirectory

func GetApplicationDirectory(): str
Returns application directory.

ChangeDirectory

func ChangeDirectory(dir: str): bool
Change directory.

IsPathFile

func IsPathFile(path: str): bool
Returns true when path file holds.

IsFileNameValid

func IsFileNameValid(fileName: str): bool
Returns true when the file name loaded correctly.

LoadDirectoryFiles

func LoadDirectoryFiles(dirPath: str): FilePathList
Loads directory files and returns it.

UnloadDirectoryFiles

func UnloadDirectoryFiles(files: FilePathList)
Frees a loaded directory files.

IsFileDropped

func IsFileDropped(): bool
Returns true when file dropped holds.

LoadDroppedFiles

func LoadDroppedFiles(): FilePathList
Loads dropped files and returns it.

UnloadDroppedFiles

func UnloadDroppedFiles(files: FilePathList)
Frees a loaded dropped files.

LoadFileText

func LoadFileText(fileName: str): str
Loads file text and returns it.

UnloadFileText

func UnloadFileText(text: str)
Frees a loaded file text.

SaveFileText

func SaveFileText(fileName: str, text: str): bool
Save file text.

LoadFileData

func LoadFileData(fileName: str, dataSize &: int): u8*
Loads file data and returns it.

UnloadFileData

func UnloadFileData(data: u8*)
Frees a loaded file data.

SaveFileData

func SaveFileData(fileName: str, data: void*, dataSize: int): bool
Save file data.

SetWindowOpacity

func SetWindowOpacity(opacity: f64)
Sets window opacity.

DrawLine3D

func DrawLine3D(startPos: Vector3, endPos: Vector3, color: Color)
Draws line 3D.

DrawPoint3D

func DrawPoint3D(position: Vector3, color: Color)
Draws point 3D.

DrawCircle3D

func DrawCircle3D(center: Vector3, radius: f32, rotationAxis: Vector3, rotationAngle: f32, color: Color)
Draws circle 3D.

DrawTriangle3D

func DrawTriangle3D(v1: Vector3, v2: Vector3, v3: Vector3, color: Color)
Draws triangle 3D.

DrawTriangleStrip3D

func DrawTriangleStrip3D(points: Vector3*, pointCount: int, color: Color)
Draws triangle strip 3D.

DrawCube

func DrawCube(position: Vector3, width: f32, height: f32, length: f32, color: Color)
Draws cube.

DrawCubeV

func DrawCubeV(position: Vector3, size: Vector3, color: Color)
Draws cube.

DrawCubeWires

func DrawCubeWires(position: Vector3, width: f32, height: f32, length: f32, color: Color)
Draws cube wires.

DrawCubeWiresV

func DrawCubeWiresV(position: Vector3, size: Vector3, color: Color)
Draws cube wires.

DrawSphere

func DrawSphere(centerPos: Vector3, radius: f32, color: Color)
Draws sphere.

DrawSphereEx

func DrawSphereEx(centerPos: Vector3, radius: f32, rings: int, slices: int, color: Color)
Draws sphere.

DrawSphereWires

func DrawSphereWires(centerPos: Vector3, radius: f32, rings: int, slices: int, color: Color)
Draws sphere wires.

DrawCylinder

func DrawCylinder(position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: int, color: Color)
Draws cylinder.

DrawCylinderEx

func DrawCylinderEx(startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: int, color: Color)
Draws cylinder.

DrawCylinderWires

func DrawCylinderWires(position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: int, color: Color)
Draws cylinder wires.

DrawCylinderWiresEx

func DrawCylinderWiresEx(startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: int, color: Color)
Draws cylinder wires.

DrawCapsule

func DrawCapsule(startPos: Vector3, endPos: Vector3, radius: f32, slices: int, rings: int, color: Color)
Draws capsule.

DrawCapsuleWires

func DrawCapsuleWires(startPos: Vector3, endPos: Vector3, radius: f32, slices: int, rings: int, color: Color)
Draws capsule wires.

DrawPlane

func DrawPlane(centerPos: Vector3, size: Vector2, color: Color)
Draws plane.

DrawRay

func DrawRay(ray: Ray, color: Color)
Draws ray.

DrawGrid

func DrawGrid(slices: int, spacing: f32)
Draws grid.

LoadModel

func LoadModel(fileName: str): Model
Loads model and returns it.

LoadModelFromMesh

func LoadModelFromMesh(mesh: Mesh): Model
Loads model from mesh and returns it.

IsModelValid

func IsModelValid(model: Model): bool
Returns true when the model loaded correctly.

UnloadModel

func UnloadModel(model: Model)
Frees a loaded model.

GetModelBoundingBox

func GetModelBoundingBox(model: Model): BoundingBox
Returns model bounding box.

DrawModel

func DrawModel(model: Model, position: Vector3, scale: f32, tint: Color)
Draws model.

DrawModelEx

func DrawModelEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color)
Draws model.

DrawModelWires

func DrawModelWires(model: Model, position: Vector3, scale: f32, tint: Color)
Draws model wires.

DrawModelWiresEx

func DrawModelWiresEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color)
Draws model wires.

DrawBoundingBox

func DrawBoundingBox(box: BoundingBox, color: Color)
Draws bounding box.

DrawBillboard

func DrawBillboard(camera: Camera3D, texture: Texture, position: Vector3, scale: f32, tint: Color)
Draws billboard.

DrawBillboardRec

func DrawBillboardRec(camera: Camera3D, texture: Texture, source: Rectangle, position: Vector3, size: Vector2, tint: Color)
Draws billboard rectangle.

UploadMesh

func UploadMesh(mesh &: Mesh, dynamic: bool)
Upload mesh.

UnloadMesh

func UnloadMesh(mesh: Mesh)
Frees a loaded mesh.

DrawMesh

func DrawMesh(mesh: Mesh, material: Material, transform: Matrix)
Draws mesh.

GetMeshBoundingBox

func GetMeshBoundingBox(mesh: Mesh): BoundingBox
Returns mesh bounding box.

GenMeshTangents

func GenMeshTangents(mesh &: Mesh)
Generates mesh tangents.

ExportMesh

func ExportMesh(mesh: Mesh, fileName: str): bool
Export mesh.

GenMeshPoly

func GenMeshPoly(sides: int, radius: f32): Mesh
Generates mesh poly.

GenMeshPlane

func GenMeshPlane(width: f32, length: f32, resX: int, resZ: int): Mesh
Generates mesh plane.

GenMeshCube

func GenMeshCube(width: f32, height: f32, length: f32): Mesh
Generates mesh cube.

GenMeshSphere

func GenMeshSphere(radius: f32, rings: int, slices: int): Mesh
Generates mesh sphere.

GenMeshHemiSphere

func GenMeshHemiSphere(radius: f32, rings: int, slices: int): Mesh
Generates mesh hemi sphere.

GenMeshCylinder

func GenMeshCylinder(radius: f32, height: f32, slices: int): Mesh
Generates mesh cylinder.

GenMeshCone

func GenMeshCone(radius: f32, height: f32, slices: int): Mesh
Generates mesh cone.

GenMeshTorus

func GenMeshTorus(radius: f32, size: f32, radSeg: int, sides: int): Mesh
Generates mesh torus.

GenMeshKnot

func GenMeshKnot(radius: f32, size: f32, radSeg: int, sides: int): Mesh
Generates mesh knot.

GenMeshHeightmap

func GenMeshHeightmap(heightmap: Image, size: Vector3): Mesh
Generates mesh heightmap.

GenMeshCubicmap

func GenMeshCubicmap(cubicmap: Image, cubeSize: Vector3): Mesh
Generates mesh cubicmap.

LoadMaterialDefault

func LoadMaterialDefault(): Material
Loads material default and returns it.

IsMaterialValid

func IsMaterialValid(material: Material): bool
Returns true when the material loaded correctly.

UnloadMaterial

func UnloadMaterial(material: Material)
Frees a loaded material.

SetMaterialTexture

func SetMaterialTexture(material &: Material, mapType: int, texture: Texture)
Sets material texture.

SetModelMeshMaterial

func SetModelMeshMaterial(model &: Model, meshId: int, materialId: int)
Sets model mesh material.

LoadModelAnimations

func LoadModelAnimations(fileName: str, animCount &: int): ModelAnimation*
Loads model animations and returns it.

UpdateModelAnimation

func UpdateModelAnimation(model: Model, anim: ModelAnimation, frame: int)
Updates model animation.

UnloadModelAnimation

func UnloadModelAnimation(anim: ModelAnimation)
Frees a loaded model animation.

UnloadModelAnimations

func UnloadModelAnimations(animations: ModelAnimation*, animCount: int)
Frees a loaded model animations.

IsModelAnimationValid

func IsModelAnimationValid(model: Model, anim: ModelAnimation): bool
Returns true when the model animation loaded correctly.

CheckCollisionSpheres

func CheckCollisionSpheres(center1: Vector3, radius1: f32, center2: Vector3, radius2: f32): bool
Returns true when the shapes (spheres) collide.

CheckCollisionBoxes

func CheckCollisionBoxes(box1: BoundingBox, box2: BoundingBox): bool
Returns true when the shapes (boxes) collide.

CheckCollisionBoxSphere

func CheckCollisionBoxSphere(box: BoundingBox, center: Vector3, radius: f32): bool
Returns true when the shapes (box sphere) collide.

GetRayCollisionSphere

func GetRayCollisionSphere(ray: Ray, center: Vector3, radius: f32): RayCollision
Returns ray collision sphere.

GetRayCollisionBox

func GetRayCollisionBox(ray: Ray, box: BoundingBox): RayCollision
Returns ray collision box.

GetRayCollisionMesh

func GetRayCollisionMesh(ray: Ray, mesh: Mesh, transform: Matrix): RayCollision
Returns ray collision mesh.

GetRayCollisionTriangle

func GetRayCollisionTriangle(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3): RayCollision
Returns ray collision triangle.

GetRayCollisionQuad

func GetRayCollisionQuad(ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3): RayCollision
Returns ray collision quad.

DrawCircle3D

func DrawCircle3D(center: Vector3, radius: f64, rotationAxis: Vector3, rotationAngle: f64, color: Color)
Draws circle 3D.

DrawCube

func DrawCube(position: Vector3, width: f64, height: f64, length: f64, color: Color)
Draws cube.

DrawCubeWires

func DrawCubeWires(position: Vector3, width: f64, height: f64, length: f64, color: Color)
Draws cube wires.

DrawSphere

func DrawSphere(centerPos: Vector3, radius: f64, color: Color)
Draws sphere.

DrawSphereEx

func DrawSphereEx(centerPos: Vector3, radius: f64, rings: int, slices: int, color: Color)
Draws sphere.

DrawSphereWires

func DrawSphereWires(centerPos: Vector3, radius: f64, rings: int, slices: int, color: Color)
Draws sphere wires.

DrawCylinder

func DrawCylinder(position: Vector3, radiusTop: f64, radiusBottom: f64, height: f64, slices: int, color: Color)
Draws cylinder.

DrawCylinderEx

func DrawCylinderEx(startPos: Vector3, endPos: Vector3, startRadius: f64, endRadius: f64, sides: int, color: Color)
Draws cylinder.

DrawCylinderWires

func DrawCylinderWires(position: Vector3, radiusTop: f64, radiusBottom: f64, height: f64, slices: int, color: Color)
Draws cylinder wires.

DrawCylinderWiresEx

func DrawCylinderWiresEx(startPos: Vector3, endPos: Vector3, startRadius: f64, endRadius: f64, sides: int, color: Color)
Draws cylinder wires.

DrawCapsule

func DrawCapsule(startPos: Vector3, endPos: Vector3, radius: f64, slices: int, rings: int, color: Color)
Draws capsule.

DrawCapsuleWires

func DrawCapsuleWires(startPos: Vector3, endPos: Vector3, radius: f64, slices: int, rings: int, color: Color)
Draws capsule wires.

DrawGrid

func DrawGrid(slices: int, spacing: f64)
Draws grid.

DrawModel

func DrawModel(model: Model, position: Vector3, scale: f64, tint: Color)
Draws model.

DrawModelEx

func DrawModelEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f64, scale: Vector3, tint: Color)
Draws model.

DrawModelWires

func DrawModelWires(model: Model, position: Vector3, scale: f64, tint: Color)
Draws model wires.

DrawModelWiresEx

func DrawModelWiresEx(model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f64, scale: Vector3, tint: Color)
Draws model wires.

DrawBillboard

func DrawBillboard(camera: Camera3D, texture: Texture, position: Vector3, scale: f64, tint: Color)
Draws billboard.

GenMeshPoly

func GenMeshPoly(sides: int, radius: f64): Mesh
Generates mesh poly.

GenMeshPlane

func GenMeshPlane(width: f64, length: f64, resX: int, resZ: int): Mesh
Generates mesh plane.

GenMeshCube

func GenMeshCube(width: f64, height: f64, length: f64): Mesh
Generates mesh cube.

GenMeshSphere

func GenMeshSphere(radius: f64, rings: int, slices: int): Mesh
Generates mesh sphere.

GenMeshHemiSphere

func GenMeshHemiSphere(radius: f64, rings: int, slices: int): Mesh
Generates mesh hemi sphere.

GenMeshCylinder

func GenMeshCylinder(radius: f64, height: f64, slices: int): Mesh
Generates mesh cylinder.

GenMeshCone

func GenMeshCone(radius: f64, height: f64, slices: int): Mesh
Generates mesh cone.

GenMeshTorus

func GenMeshTorus(radius: f64, size: f64, radSeg: int, sides: int): Mesh
Generates mesh torus.

GenMeshKnot

func GenMeshKnot(radius: f64, size: f64, radSeg: int, sides: int): Mesh
Generates mesh knot.

CheckCollisionSpheres

func CheckCollisionSpheres(center1: Vector3, radius1: f64, center2: Vector3, radius2: f64): bool
Returns true when the shapes (spheres) collide.

CheckCollisionBoxSphere

func CheckCollisionBoxSphere(box: BoundingBox, center: Vector3, radius: f64): bool
Returns true when the shapes (box sphere) collide.

GetRayCollisionSphere

func GetRayCollisionSphere(ray: Ray, center: Vector3, radius: f64): RayCollision
Returns ray collision sphere.

Vec2

func Vec2(x: f64, y: f64): Vector2
Builds a Vector2 from f64 values.

Vec3

func Vec3(x: f64, y: f64, z: f64): Vector3
Builds a Vector3 from f64 values.

Vec4

func Vec4(x: f64, y: f64, z: f64, w: f64): Vector4
Builds a Vector4 from f64 values.

Rect

func Rect(x: f64, y: f64, width: f64, height: f64): Rectangle
Builds a Rectangle from f64 values.

RGB

func RGB(r: int, g: int, b: int): Color
Builds an opaque Color from red, green and blue values.

RGBA

func RGBA(r: int, g: int, b: int, a: int): Color
Builds a Color from red, green, blue and alpha values.

NewCamera2D

func NewCamera2D(offset: Vector2, target: Vector2, rotation: f64, zoom: f64): Camera2D
Builds a Camera2D from f64 values.

NewCamera3D

func NewCamera3D(position: Vector3, target: Vector3, up: Vector3, fovy: f64, projection: int): Camera3D
Builds a Camera3D from f64 values.

LightGray

func LightGray(): Color
The raylib LightGray color.

Gray

func Gray(): Color
The raylib Gray color.

DarkGray

func DarkGray(): Color
The raylib DarkGray color.

Yellow

func Yellow(): Color
The raylib Yellow color.

Gold

func Gold(): Color
The raylib Gold color.

Orange

func Orange(): Color
The raylib Orange color.

Pink

func Pink(): Color
The raylib Pink color.

Red

func Red(): Color
The raylib Red color.

Maroon

func Maroon(): Color
The raylib Maroon color.

Green

func Green(): Color
The raylib Green color.

Lime

func Lime(): Color
The raylib Lime color.

DarkGreen

func DarkGreen(): Color
The raylib DarkGreen color.

SkyBlue

func SkyBlue(): Color
The raylib SkyBlue color.

Blue

func Blue(): Color
The raylib Blue color.

DarkBlue

func DarkBlue(): Color
The raylib DarkBlue color.

Purple

func Purple(): Color
The raylib Purple color.

Violet

func Violet(): Color
The raylib Violet color.

DarkPurple

func DarkPurple(): Color
The raylib DarkPurple color.

Beige

func Beige(): Color
The raylib Beige color.

Brown

func Brown(): Color
The raylib Brown color.

DarkBrown

func DarkBrown(): Color
The raylib DarkBrown color.

White

func White(): Color
The raylib White color.

Black

func Black(): Color
The raylib Black color.

Blank

func Blank(): Color
The raylib Blank color.

Magenta

func Magenta(): Color
The raylib Magenta color.

RayWhite

func RayWhite(): Color
The raylib RayWhite color.

LoadImage

func LoadImage(fileName: str): Image
Loads image and returns it.

LoadImageRaw

func LoadImageRaw(fileName: str, width: int, height: int, format: int, headerSize: int): Image
Loads image raw and returns it.

LoadImageFromMemory

func LoadImageFromMemory(fileType: str, fileData: u8*, dataSize: int): Image
Loads image from memory and returns it.

LoadImageFromTexture

func LoadImageFromTexture(texture: Texture): Image
Loads image from texture and returns it.

LoadImageFromScreen

func LoadImageFromScreen(): Image
Loads image from screen and returns it.

IsImageValid

func IsImageValid(image: Image): bool
Returns true when the image loaded correctly.

UnloadImage

func UnloadImage(image: Image)
Frees a loaded image.

ExportImage

func ExportImage(image: Image, fileName: str): bool
Export image.

GenImageColor

func GenImageColor(width: int, height: int, color: Color): Image
Generates image color.

GenImageGradientLinear

func GenImageGradientLinear(width: int, height: int, direction: int, startColor: Color, endColor: Color): Image
Generates image gradient linear.

GenImageGradientRadial

func GenImageGradientRadial(width: int, height: int, density: f32, inner: Color, outer: Color): Image
Generates image gradient radial.

GenImageGradientSquare

func GenImageGradientSquare(width: int, height: int, density: f32, inner: Color, outer: Color): Image
Generates image gradient square.

GenImageChecked

func GenImageChecked(width: int, height: int, checksX: int, checksY: int, col1: Color, col2: Color): Image
Generates image checked.

GenImageWhiteNoise

func GenImageWhiteNoise(width: int, height: int, factor: f32): Image
Generates image white noise.

GenImagePerlinNoise

func GenImagePerlinNoise(width: int, height: int, offsetX: int, offsetY: int, scale: f32): Image
Generates image perlin noise.

GenImageCellular

func GenImageCellular(width: int, height: int, tileSize: int): Image
Generates image cellular.

ImageCopy

func ImageCopy(image: Image): Image
Image copy.

ImageFromImage

func ImageFromImage(image: Image, rec: Rectangle): Image
Image from image.

ImageText

func ImageText(text: str, fontSize: int, color: Color): Image
Image text.

ImageFormat

func ImageFormat(image &: Image, newFormat: int)
Image format.

ImageToPOT

func ImageToPOT(image &: Image, fill: Color)
Image to power of two.

ImageCrop

func ImageCrop(image &: Image, crop: Rectangle)
Image crop.

ImageAlphaCrop

func ImageAlphaCrop(image &: Image, threshold: f32)
Image alpha crop.

ImageAlphaClear

func ImageAlphaClear(image &: Image, color: Color, threshold: f32)
Image alpha clear.

ImageAlphaMask

func ImageAlphaMask(image &: Image, alphaMask: Image)
Image alpha mask.

ImageAlphaPremultiply

func ImageAlphaPremultiply(image &: Image)
Image alpha premultiply.

ImageBlurGaussian

func ImageBlurGaussian(image &: Image, blurSize: int)
Image blur gaussian.

ImageResize

func ImageResize(image &: Image, newWidth: int, newHeight: int)
Image resize.

ImageResizeNN

func ImageResizeNN(image &: Image, newWidth: int, newHeight: int)
Image resize nearest neighbour.

ImageResizeCanvas

func ImageResizeCanvas(image &: Image, newWidth: int, newHeight: int, offsetX: int, offsetY: int, fill: Color)
Image resize canvas.

ImageMipmaps

func ImageMipmaps(image &: Image)
Image mipmaps.

ImageDither

func ImageDither(image &: Image, rBpp: int, gBpp: int, bBpp: int, aBpp: int)
Image dither.

ImageFlipVertical

func ImageFlipVertical(image &: Image)
Image flip vertical.

ImageFlipHorizontal

func ImageFlipHorizontal(image &: Image)
Image flip horizontal.

ImageRotate

func ImageRotate(image &: Image, degrees: int)
Image rotate.

ImageRotateCW

func ImageRotateCW(image &: Image)
Image rotate clockwise.

ImageRotateCCW

func ImageRotateCCW(image &: Image)
Image rotate counter-clockwise.

ImageColorTint

func ImageColorTint(image &: Image, color: Color)
Image color tint.

ImageColorInvert

func ImageColorInvert(image &: Image)
Image color invert.

ImageColorGrayscale

func ImageColorGrayscale(image &: Image)
Image color grayscale.

ImageColorContrast

func ImageColorContrast(image &: Image, contrast: f32)
Image color contrast.

ImageColorBrightness

func ImageColorBrightness(image &: Image, brightness: int)
Image color brightness.

ImageColorReplace

func ImageColorReplace(image &: Image, color: Color, replace: Color)
Image color replace.

LoadImageColors

func LoadImageColors(image: Image): Color*
Loads image colors and returns it.

UnloadImageColors

func UnloadImageColors(colors: Color*)
Frees a loaded image colors.

GetImageAlphaBorder

func GetImageAlphaBorder(image: Image, threshold: f32): Rectangle
Returns image alpha border.

GetImageColor

func GetImageColor(image: Image, x: int, y: int): Color
Returns image color.

ImageClearBackground

func ImageClearBackground(dst &: Image, color: Color)
Image clear background.

ImageDrawPixel

func ImageDrawPixel(dst &: Image, posX: int, posY: int, color: Color)
Image draw pixel.

ImageDrawPixelV

func ImageDrawPixelV(dst &: Image, position: Vector2, color: Color)
Image draw pixel.

ImageDrawLine

func ImageDrawLine(dst &: Image, startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: Color)
Image draw line.

ImageDrawLineV

func ImageDrawLineV(dst &: Image, startPos: Vector2, endPos: Vector2, color: Color)
Image draw line.

ImageDrawCircle

func ImageDrawCircle(dst &: Image, centerX: int, centerY: int, radius: int, color: Color)
Image draw circle.

ImageDrawCircleV

func ImageDrawCircleV(dst &: Image, center: Vector2, radius: int, color: Color)
Image draw circle.

ImageDrawRectangle

func ImageDrawRectangle(dst &: Image, posX: int, posY: int, width: int, height: int, color: Color)
Image draw rectangle.

ImageDrawRectangleV

func ImageDrawRectangleV(dst &: Image, position: Vector2, size: Vector2, color: Color)
Image draw rectangle.

ImageDrawRectangleRec

func ImageDrawRectangleRec(dst &: Image, rec: Rectangle, color: Color)
Image draw rectangle rectangle.

ImageDrawRectangleLines

func ImageDrawRectangleLines(dst &: Image, rec: Rectangle, thick: int, color: Color)
Image draw rectangle lines.

ImageDraw

func ImageDraw(dst &: Image, src: Image, srcRec: Rectangle, dstRec: Rectangle, tint: Color)
Image draw.

ImageDrawText

func ImageDrawText(dst &: Image, text: str, posX: int, posY: int, fontSize: int, color: Color)
Image draw text.

LoadTexture

func LoadTexture(fileName: str): Texture
Loads texture and returns it.
gui-raylib-LoadTexture.salam
import gui.raylib

func main:
    raylib.InitWindow(400, 300, "Texture")
    tex := raylib.LoadTexture("logo.png")
    until not raylib.WindowShouldClose():
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawTexture(tex, 100, 50, raylib.White())
        raylib.EndDrawing()
    end
    raylib.UnloadTexture(tex)
    raylib.CloseWindow()
end

LoadTextureFromImage

func LoadTextureFromImage(image: Image): Texture
Loads texture from image and returns it.

LoadTextureCubemap

func LoadTextureCubemap(image: Image, cubeLayout: int): Texture
Loads texture cubemap and returns it.

LoadRenderTexture

func LoadRenderTexture(width: int, height: int): RenderTexture
Loads render texture and returns it.

IsTextureValid

func IsTextureValid(texture: Texture): bool
Returns true when the texture loaded correctly.

UnloadTexture

func UnloadTexture(texture: Texture)
Frees a loaded texture.

IsRenderTextureValid

func IsRenderTextureValid(target: RenderTexture): bool
Returns true when the render texture loaded correctly.

UnloadRenderTexture

func UnloadRenderTexture(target: RenderTexture)
Frees a loaded render texture.

UpdateTexture

func UpdateTexture(texture: Texture, pixels: void*)
Updates texture.

UpdateTextureRec

func UpdateTextureRec(texture: Texture, rec: Rectangle, pixels: void*)
Updates texture rectangle.

GenTextureMipmaps

func GenTextureMipmaps(texture &: Texture)
Generates texture mipmaps.

SetTextureFilter

func SetTextureFilter(texture: Texture, filter: int)
Sets texture filter.

SetTextureWrap

func SetTextureWrap(texture: Texture, wrap: int)
Sets texture wrap.

DrawTexture

func DrawTexture(texture: Texture, posX: int, posY: int, tint: Color)
Draws texture.

DrawTextureV

func DrawTextureV(texture: Texture, position: Vector2, tint: Color)
Draws texture.

DrawTextureEx

func DrawTextureEx(texture: Texture, position: Vector2, rotation: f32, scale: f32, tint: Color)
Draws texture.

DrawTextureRec

func DrawTextureRec(texture: Texture, source: Rectangle, position: Vector2, tint: Color)
Draws texture rectangle.

DrawTexturePro

func DrawTexturePro(texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color)
Draws texture.

DrawTextureNPatch

func DrawTextureNPatch(texture: Texture, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color)
Draws texture NP atch.

ColorIsEqual

func ColorIsEqual(col1: Color, col2: Color): bool
Color is equal.

Fade

func Fade(color: Color, alpha: f32): Color
Fade.

ColorToInt

func ColorToInt(color: Color): int
Color to int.

ColorNormalize

func ColorNormalize(color: Color): Vector4
Color normalize.

ColorFromNormalized

func ColorFromNormalized(normalized: Vector4): Color
Color from normalized.

ColorToHSV

func ColorToHSV(color: Color): Vector3
Color to HSV.

ColorFromHSV

func ColorFromHSV(hue: f32, saturation: f32, value: f32): Color
Color from HSV.

ColorTint

func ColorTint(color: Color, tint: Color): Color
Color tint.

ColorBrightness

func ColorBrightness(color: Color, factor: f32): Color
Color brightness.

ColorContrast

func ColorContrast(color: Color, contrast: f32): Color
Color contrast.

ColorAlpha

func ColorAlpha(color: Color, alpha: f32): Color
Color alpha.

ColorAlphaBlend

func ColorAlphaBlend(dst: Color, src: Color, tint: Color): Color
Color alpha blend.

ColorLerp

func ColorLerp(color1: Color, color2: Color, factor: f32): Color
Color lerp.

GetColor

func GetColor(hexValue: u32): Color
Returns color.

GetPixelColor

func GetPixelColor(srcPtr: void*, format: int): Color
Returns pixel color.

SetPixelColor

func SetPixelColor(dstPtr: void*, color: Color, format: int)
Sets pixel color.

GetPixelDataSize

func GetPixelDataSize(width: int, height: int, format: int): int
Returns pixel data size.

GenImageGradientRadial

func GenImageGradientRadial(width: int, height: int, density: f64, inner: Color, outer: Color): Image
Generates image gradient radial.

GenImageGradientSquare

func GenImageGradientSquare(width: int, height: int, density: f64, inner: Color, outer: Color): Image
Generates image gradient square.

GenImageWhiteNoise

func GenImageWhiteNoise(width: int, height: int, factor: f64): Image
Generates image white noise.

GenImagePerlinNoise

func GenImagePerlinNoise(width: int, height: int, offsetX: int, offsetY: int, scale: f64): Image
Generates image perlin noise.

ImageAlphaCrop

func ImageAlphaCrop(image &: Image, threshold: f64)
Image alpha crop.

ImageAlphaClear

func ImageAlphaClear(image &: Image, color: Color, threshold: f64)
Image alpha clear.

ImageColorContrast

func ImageColorContrast(image &: Image, contrast: f64)
Image color contrast.

GetImageAlphaBorder

func GetImageAlphaBorder(image: Image, threshold: f64): Rectangle
Returns image alpha border.

DrawTextureEx

func DrawTextureEx(texture: Texture, position: Vector2, rotation: f64, scale: f64, tint: Color)
Draws texture.

DrawTexturePro

func DrawTexturePro(texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f64, tint: Color)
Draws texture.

DrawTextureNPatch

func DrawTextureNPatch(texture: Texture, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f64, tint: Color)
Draws texture NP atch.

Fade

func Fade(color: Color, alpha: f64): Color
Fade.

ColorFromHSV

func ColorFromHSV(hue: f64, saturation: f64, value: f64): Color
Color from HSV.

ColorBrightness

func ColorBrightness(color: Color, factor: f64): Color
Color brightness.

ColorContrast

func ColorContrast(color: Color, contrast: f64): Color
Color contrast.

ColorAlpha

func ColorAlpha(color: Color, alpha: f64): Color
Color alpha.

ColorLerp

func ColorLerp(color1: Color, color2: Color, factor: f64): Color
Color lerp.

SetShapesTexture

func SetShapesTexture(texture: Texture, source: Rectangle)
Sets shapes texture.

GetShapesTexture

func GetShapesTexture(): Texture
Returns shapes texture.

GetShapesTextureRectangle

func GetShapesTextureRectangle(): Rectangle
Returns shapes texture rectangle.

DrawPixel

func DrawPixel(posX: int, posY: int, color: Color)
Draws pixel.

DrawPixelV

func DrawPixelV(position: Vector2, color: Color)
Draws pixel.

DrawLine

func DrawLine(startPosX: int, startPosY: int, endPosX: int, endPosY: int, color: Color)
Draws line.

DrawLineV

func DrawLineV(startPos: Vector2, endPos: Vector2, color: Color)
Draws line.

DrawLineEx

func DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color)
Draws line.

DrawLineStrip

func DrawLineStrip(points: Vector2*, pointCount: int, color: Color)
Draws line strip.

DrawLineBezier

func DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color)
Draws line bezier.

DrawCircle

func DrawCircle(centerX: int, centerY: int, radius: f32, color: Color)
Draws circle.
gui-raylib-DrawCircle.salam
import gui.raylib

func main:
    raylib.InitWindow(400, 300, "Circles")
    until not raylib.WindowShouldClose():
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawCircle(200, 150, 80.0, raylib.SkyBlue())
        raylib.DrawCircleLines(200, 150, 80.0, raylib.DarkBlue())
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

DrawCircleSector

func DrawCircleSector(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: int, color: Color)
Draws circle sector.

DrawCircleSectorLines

func DrawCircleSectorLines(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: int, color: Color)
Draws circle sector lines.

DrawCircleGradient

func DrawCircleGradient(centerX: int, centerY: int, radius: f32, inner: Color, outer: Color)
Draws circle gradient.

DrawCircleV

func DrawCircleV(center: Vector2, radius: f32, color: Color)
Draws circle.

DrawCircleLines

func DrawCircleLines(centerX: int, centerY: int, radius: f32, color: Color)
Draws circle lines.

DrawCircleLinesV

func DrawCircleLinesV(center: Vector2, radius: f32, color: Color)
Draws circle lines.

DrawEllipse

func DrawEllipse(centerX: int, centerY: int, radiusH: f32, radiusV: f32, color: Color)
Draws ellipse.

DrawEllipseLines

func DrawEllipseLines(centerX: int, centerY: int, radiusH: f32, radiusV: f32, color: Color)
Draws ellipse lines.

DrawRing

func DrawRing(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: int, color: Color)
Draws ring.

DrawRingLines

func DrawRingLines(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: int, color: Color)
Draws ring lines.

DrawRectangle

func DrawRectangle(posX: int, posY: int, width: int, height: int, color: Color)
Draws rectangle.

DrawRectangleV

func DrawRectangleV(position: Vector2, size: Vector2, color: Color)
Draws rectangle.

DrawRectangleRec

func DrawRectangleRec(rec: Rectangle, color: Color)
Draws rectangle rectangle.

DrawRectanglePro

func DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color)
Draws rectangle.

DrawRectangleGradientV

func DrawRectangleGradientV(posX: int, posY: int, width: int, height: int, top: Color, bottom: Color)
Draws rectangle gradient.

DrawRectangleGradientH

func DrawRectangleGradientH(posX: int, posY: int, width: int, height: int, left: Color, right: Color)
Draws rectangle gradient h.

DrawRectangleGradientEx

func DrawRectangleGradientEx(rec: Rectangle, topLeft: Color, bottomLeft: Color, topRight: Color, bottomRight: Color)
Draws rectangle gradient.

DrawRectangleLines

func DrawRectangleLines(posX: int, posY: int, width: int, height: int, color: Color)
Draws rectangle lines.

DrawRectangleLinesEx

func DrawRectangleLinesEx(rec: Rectangle, lineThick: f32, color: Color)
Draws rectangle lines.

DrawRectangleRounded

func DrawRectangleRounded(rec: Rectangle, roundness: f32, segments: int, color: Color)
Draws rectangle rounded.

DrawTriangle

func DrawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color)
Draws triangle.

DrawTriangleLines

func DrawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color)
Draws triangle lines.

DrawTriangleFan

func DrawTriangleFan(points: Vector2*, pointCount: int, color: Color)
Draws triangle fan.

DrawTriangleStrip

func DrawTriangleStrip(points: Vector2*, pointCount: int, color: Color)
Draws triangle strip.

DrawPoly

func DrawPoly(center: Vector2, sides: int, radius: f32, rotation: f32, color: Color)
Draws poly.

DrawPolyLines

func DrawPolyLines(center: Vector2, sides: int, radius: f32, rotation: f32, color: Color)
Draws poly lines.

DrawPolyLinesEx

func DrawPolyLinesEx(center: Vector2, sides: int, radius: f32, rotation: f32, lineThick: f32, color: Color)
Draws poly lines.

DrawSplineLinear

func DrawSplineLinear(points: Vector2*, pointCount: int, thick: f32, color: Color)
Draws spline linear.

DrawSplineBasis

func DrawSplineBasis(points: Vector2*, pointCount: int, thick: f32, color: Color)
Draws spline basis.

DrawSplineCatmullRom

func DrawSplineCatmullRom(points: Vector2*, pointCount: int, thick: f32, color: Color)
Draws spline catmull rom.

DrawSplineBezierQuadratic

func DrawSplineBezierQuadratic(points: Vector2*, pointCount: int, thick: f32, color: Color)
Draws spline bezier quadratic.

DrawSplineBezierCubic

func DrawSplineBezierCubic(points: Vector2*, pointCount: int, thick: f32, color: Color)
Draws spline bezier cubic.

CheckCollisionRecs

func CheckCollisionRecs(rec1: Rectangle, rec2: Rectangle): bool
Returns true when the shapes (recs) collide.
gui-raylib-CheckCollisionRecs.salam
import gui.raylib

func main:
    raylib.InitWindow(400, 300, "Collision")
    a := raylib.Rect(50.0, 50.0, 100.0, 100.0)
    until not raylib.WindowShouldClose():
        mouse := raylib.GetMousePosition()
        b := raylib.Rect(mouse.x as f64, mouse.y as f64, 60.0, 60.0)
        hit := raylib.CheckCollisionRecs(a, b)
        raylib.BeginDrawing()
        raylib.ClearBackground(raylib.RayWhite())
        raylib.DrawRectangleRec(a, hit ? raylib.Red() : raylib.Green())
        raylib.DrawRectangleRec(b, raylib.Fade(raylib.Blue(), 0.5))
        raylib.EndDrawing()
    end
    raylib.CloseWindow()
end

CheckCollisionCircles

func CheckCollisionCircles(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32): bool
Returns true when the shapes (circles) collide.

CheckCollisionCircleRec

func CheckCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle): bool
Returns true when the shapes (circle rectangle) collide.

CheckCollisionPointRec

func CheckCollisionPointRec(point: Vector2, rec: Rectangle): bool
Returns true when the shapes (point rectangle) collide.

CheckCollisionPointCircle

func CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f32): bool
Returns true when the shapes (point circle) collide.

CheckCollisionPointTriangle

func CheckCollisionPointTriangle(point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): bool
Returns true when the shapes (point triangle) collide.

CheckCollisionPointLine

func CheckCollisionPointLine(point: Vector2, p1: Vector2, p2: Vector2, threshold: int): bool
Returns true when the shapes (point line) collide.

CheckCollisionPointPoly

func CheckCollisionPointPoly(point: Vector2, points: Vector2*, pointCount: int): bool
Returns true when the shapes (point poly) collide.

CheckCollisionLines

func CheckCollisionLines(startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint &: Vector2): bool
Returns true when the shapes (lines) collide.

GetCollisionRec

func GetCollisionRec(rec1: Rectangle, rec2: Rectangle): Rectangle
Returns collision rectangle.

DrawLineEx

func DrawLineEx(startPos: Vector2, endPos: Vector2, thick: f64, color: Color)
Draws line.

DrawLineBezier

func DrawLineBezier(startPos: Vector2, endPos: Vector2, thick: f64, color: Color)
Draws line bezier.

DrawCircle

func DrawCircle(centerX: int, centerY: int, radius: f64, color: Color)
Draws circle.

The example for this item is shown with the ones above: gui-raylib-DrawCircle.salam

DrawCircleSector

func DrawCircleSector(center: Vector2, radius: f64, startAngle: f64, endAngle: f64, segments: int, color: Color)
Draws circle sector.

DrawCircleSectorLines

func DrawCircleSectorLines(center: Vector2, radius: f64, startAngle: f64, endAngle: f64, segments: int, color: Color)
Draws circle sector lines.

DrawCircleGradient

func DrawCircleGradient(centerX: int, centerY: int, radius: f64, inner: Color, outer: Color)
Draws circle gradient.

DrawCircleV

func DrawCircleV(center: Vector2, radius: f64, color: Color)
Draws circle.

DrawCircleLines

func DrawCircleLines(centerX: int, centerY: int, radius: f64, color: Color)
Draws circle lines.

DrawCircleLinesV

func DrawCircleLinesV(center: Vector2, radius: f64, color: Color)
Draws circle lines.

DrawEllipse

func DrawEllipse(centerX: int, centerY: int, radiusH: f64, radiusV: f64, color: Color)
Draws ellipse.

DrawEllipseLines

func DrawEllipseLines(centerX: int, centerY: int, radiusH: f64, radiusV: f64, color: Color)
Draws ellipse lines.

DrawRing

func DrawRing(center: Vector2, innerRadius: f64, outerRadius: f64, startAngle: f64, endAngle: f64, segments: int, color: Color)
Draws ring.

DrawRingLines

func DrawRingLines(center: Vector2, innerRadius: f64, outerRadius: f64, startAngle: f64, endAngle: f64, segments: int, color: Color)
Draws ring lines.

DrawRectanglePro

func DrawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f64, color: Color)
Draws rectangle.

DrawRectangleLinesEx

func DrawRectangleLinesEx(rec: Rectangle, lineThick: f64, color: Color)
Draws rectangle lines.

DrawRectangleRounded

func DrawRectangleRounded(rec: Rectangle, roundness: f64, segments: int, color: Color)
Draws rectangle rounded.

DrawPoly

func DrawPoly(center: Vector2, sides: int, radius: f64, rotation: f64, color: Color)
Draws poly.

DrawPolyLines

func DrawPolyLines(center: Vector2, sides: int, radius: f64, rotation: f64, color: Color)
Draws poly lines.

DrawPolyLinesEx

func DrawPolyLinesEx(center: Vector2, sides: int, radius: f64, rotation: f64, lineThick: f64, color: Color)
Draws poly lines.

DrawSplineLinear

func DrawSplineLinear(points: Vector2*, pointCount: int, thick: f64, color: Color)
Draws spline linear.

DrawSplineBasis

func DrawSplineBasis(points: Vector2*, pointCount: int, thick: f64, color: Color)
Draws spline basis.

DrawSplineCatmullRom

func DrawSplineCatmullRom(points: Vector2*, pointCount: int, thick: f64, color: Color)
Draws spline catmull rom.

DrawSplineBezierQuadratic

func DrawSplineBezierQuadratic(points: Vector2*, pointCount: int, thick: f64, color: Color)
Draws spline bezier quadratic.

DrawSplineBezierCubic

func DrawSplineBezierCubic(points: Vector2*, pointCount: int, thick: f64, color: Color)
Draws spline bezier cubic.

CheckCollisionCircles

func CheckCollisionCircles(center1: Vector2, radius1: f64, center2: Vector2, radius2: f64): bool
Returns true when the shapes (circles) collide.

CheckCollisionCircleRec

func CheckCollisionCircleRec(center: Vector2, radius: f64, rec: Rectangle): bool
Returns true when the shapes (circle rectangle) collide.

CheckCollisionPointCircle

func CheckCollisionPointCircle(point: Vector2, center: Vector2, radius: f64): bool
Returns true when the shapes (point circle) collide.