Games and graphics with raylib: windows, 2D and 3D drawing, textures, text, input and audio.
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 Copy
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
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 Copy
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 Copy
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
Vector2struct Vector2A 2D vector.
Name Type Description xf32 = 0The x field. yf32 = 0The y field.
Vector3struct Vector3A 3D vector.
Name Type Description xf32 = 0The x field. yf32 = 0The y field. zf32 = 0The z field.
Vector4struct Vector4A 4D vector, also used as a quaternion.
Name Type Description xf32 = 0The x field. yf32 = 0The y field. zf32 = 0The z field. wf32 = 0The w field.
Matrixstruct MatrixA 4x4 matrix.
Name Type Description 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.
Colorstruct ColorA color with red, green, blue and alpha bytes.
Name Type Description ru8 = 0The r field. gu8 = 0The g field. bu8 = 0The b field. au8 = 0The a field.
Rectanglestruct RectangleA rectangle with a position and a size.
Name Type Description xf32 = 0The x field. yf32 = 0The y field. widthf32 = 0The width field. heightf32 = 0The height field.
Imagestruct ImagePixel data in CPU memory.
Name Type Description datavoid*The data field. widthint = 0The width field. heightint = 0The height field. mipmapsint = 0The mipmaps field. formatint = 0The format field.
Texturestruct TextureA texture stored in GPU memory.
Name Type Description idu32 = 0The id field. widthint = 0The width field. heightint = 0The height field. mipmapsint = 0The mipmaps field. formatint = 0The format field.
RenderTexturestruct RenderTextureA texture you can draw into.
Name Type Description idu32 = 0The id field. textureTextureThe texture field. depthTextureThe depth field.
NPatchInfostruct NPatchInfoDescribes a nine-patch texture.
Name Type Description sourceRectangleThe source field. leftint = 0The left field. topint = 0The top field. rightint = 0The right field. bottomint = 0The bottom field. layoutKindint = 0The layoutKind field.
GlyphInfostruct GlyphInfoMetrics and pixels of one font glyph.
Name Type Description valueint = 0The value field. offsetXint = 0The offsetX field. offsetYint = 0The offsetY field. advanceXint = 0The advanceX field. imageImageThe image field.
Fontstruct FontA font made of glyph rectangles in a texture.
Name Type Description baseSizeint = 0The baseSize field. glyphCountint = 0The glyphCount field. glyphPaddingint = 0The glyphPadding field. textureTextureThe texture field. recsRectangle*The recs field. glyphsGlyphInfo*The glyphs field.
Camera3Dstruct Camera3DA 3D camera.
Name Type Description positionVector3The position field. targetVector3The target field. upVector3The up field. fovyf32 = 0The fovy field. projectionint = 0The projection field.
Camera2Dstruct Camera2DA 2D camera.
Name Type Description offsetVector2The offset field. targetVector2The target field. rotationf32 = 0The rotation field. zoomf32 = 0The zoom field.
Meshstruct MeshVertex data of a 3D shape.
Name Type Description 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.
Shaderstruct ShaderA GPU shader program.
Name Type Description idu32 = 0The id field. locsint*The locs field.
MaterialMapstruct MaterialMapOne texture slot of a material.
Name Type Description textureTextureThe texture field. colorColorThe color field. valuef32 = 0The value field.
Materialstruct MaterialA shader with its texture maps.
Name Type Description shaderShaderThe shader field. mapsMaterialMap*The maps field. param0f32 = 0The param0 field. param1f32 = 0The param1 field. param2f32 = 0The param2 field. param3f32 = 0The param3 field.
struct TransformTranslation, rotation and scale.
Name Type Description translationVector3The translation field. rotationVector4The rotation field. scaleVector3The scale field.
BoneInfostruct BoneInfoA skeleton bone (the name is stored as eight 32-bit words).
Name Type Description 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.
Modelstruct ModelA set of meshes and materials.
Name Type Description 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.
ModelAnimationstruct ModelAnimationA skeletal animation for a model.
Name Type Description 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.
Raystruct RayA ray with a start and a direction.
Name Type Description positionVector3The position field. directionVector3The direction field.
RayCollisionstruct RayCollisionThe result of a ray test.
Name Type Description hitbool = falseThe hit field. distancef32 = 0The distance field. pointVector3The point field. normalVector3The normal field.
BoundingBoxstruct BoundingBoxAn axis-aligned box.
Name Type Description minVector3The min field. maxVector3The max field.
Wavestruct WaveDecoded audio samples.
Name Type Description frameCountu32 = 0The frameCount field. sampleRateu32 = 0The sampleRate field. sampleSizeu32 = 0The sampleSize field. channelsu32 = 0The channels field. datavoid*The data field.
AudioStreamstruct AudioStreamA raw audio stream.
Name Type Description buffervoid*The buffer field. processorvoid*The processor field. sampleRateu32 = 0The sampleRate field. sampleSizeu32 = 0The sampleSize field. channelsu32 = 0The channels field.
Soundstruct SoundA short sound loaded in memory.
Name Type Description streamAudioStreamThe stream field. frameCountu32 = 0The frameCount field.
Musicstruct MusicA streamed music file.
Name Type Description streamAudioStreamThe stream field. frameCountu32 = 0The frameCount field. loopingbool = falseThe looping field. ctxTypeint = 0The ctxType field. ctxDatavoid*The ctxData field.
FilePathListstruct FilePathListA list of file paths.
Name Type Description capacityu32 = 0The capacity field. countu32 = 0The count field. pathsvoid*The paths field.
Constants and variables
KEY_NULLconst KEY_NULL: i32 = 0 Keyboard key code: null.
KEY_APOSTROPHEconst KEY_APOSTROPHE: i32 = 39 Keyboard key code: apostrophe.
KEY_COMMAconst KEY_COMMA: i32 = 44 Keyboard key code: comma.
KEY_MINUSconst KEY_MINUS: i32 = 45 Keyboard key code: minus.
KEY_PERIODconst KEY_PERIOD: i32 = 46 Keyboard key code: period.
KEY_SLASHconst KEY_SLASH: i32 = 47 Keyboard key code: slash.
KEY_SEMICOLONconst KEY_SEMICOLON: i32 = 59 Keyboard key code: semicolon.
KEY_EQUALconst KEY_EQUAL: i32 = 61 Keyboard key code: equal.
KEY_LEFT_BRACKETconst KEY_LEFT_BRACKET: i32 = 91 Keyboard key code: left bracket.
KEY_BACKSLASHconst KEY_BACKSLASH: i32 = 92 Keyboard key code: backslash.
KEY_RIGHT_BRACKETconst KEY_RIGHT_BRACKET: i32 = 93 Keyboard key code: right bracket.
KEY_GRAVEconst KEY_GRAVE: i32 = 96 Keyboard key code: grave.
KEY_SPACEconst KEY_SPACE: i32 = 32 Keyboard key code: space.
KEY_ESCAPEconst KEY_ESCAPE: i32 = 256 Keyboard key code: escape.
KEY_ENTERconst KEY_ENTER: i32 = 257 Keyboard key code: enter.
KEY_TABconst KEY_TAB: i32 = 258 Keyboard key code: tab.
KEY_BACKSPACEconst KEY_BACKSPACE: i32 = 259 Keyboard key code: backspace.
KEY_INSERTconst KEY_INSERT: i32 = 260 Keyboard key code: insert.
KEY_DELETEconst KEY_DELETE: i32 = 261 Keyboard key code: delete.
KEY_RIGHTconst KEY_RIGHT: i32 = 262 Keyboard key code: right.
KEY_LEFTconst KEY_LEFT: i32 = 263 Keyboard key code: left.
KEY_DOWNconst KEY_DOWN: i32 = 264 Keyboard key code: down.
KEY_UPconst KEY_UP: i32 = 265 Keyboard key code: up.
KEY_PAGE_UPconst KEY_PAGE_UP: i32 = 266 Keyboard key code: page up.
KEY_PAGE_DOWNconst KEY_PAGE_DOWN: i32 = 267 Keyboard key code: page down.
KEY_HOMEconst KEY_HOME: i32 = 268 Keyboard key code: home.
KEY_ENDconst KEY_END: i32 = 269 Keyboard key code: end.
KEY_CAPS_LOCKconst KEY_CAPS_LOCK: i32 = 280 Keyboard key code: caps lock.
const KEY_SCROLL_LOCK: i32 = 281 Keyboard key code: scroll lock.
KEY_NUM_LOCKconst KEY_NUM_LOCK: i32 = 282 Keyboard key code: num lock.
KEY_PRINT_SCREENconst KEY_PRINT_SCREEN: i32 = 283 Keyboard key code: print screen.
KEY_PAUSEconst KEY_PAUSE: i32 = 284 Keyboard key code: pause.
KEY_LEFT_SHIFTconst KEY_LEFT_SHIFT: i32 = 340 Keyboard key code: left shift.
KEY_LEFT_CONTROLconst KEY_LEFT_CONTROL: i32 = 341 Keyboard key code: left control.
KEY_LEFT_ALTconst KEY_LEFT_ALT: i32 = 342 Keyboard key code: left alt.
KEY_LEFT_SUPERconst KEY_LEFT_SUPER: i32 = 343 Keyboard key code: left super.
KEY_RIGHT_SHIFTconst KEY_RIGHT_SHIFT: i32 = 344 Keyboard key code: right shift.
KEY_RIGHT_CONTROLconst KEY_RIGHT_CONTROL: i32 = 345 Keyboard key code: right control.
KEY_RIGHT_ALTconst KEY_RIGHT_ALT: i32 = 346 Keyboard key code: right alt.
KEY_RIGHT_SUPERconst KEY_RIGHT_SUPER: i32 = 347 Keyboard key code: right super.
const KEY_KB_MENU: i32 = 348 Keyboard key code: kb menu.
KEY_ZEROconst KEY_ZERO: i32 = 48 Keyboard key code: zero.
KEY_ONEconst KEY_ONE: i32 = 49 Keyboard key code: one.
KEY_TWOconst KEY_TWO: i32 = 50 Keyboard key code: two.
KEY_THREEconst KEY_THREE: i32 = 51 Keyboard key code: three.
KEY_FOURconst KEY_FOUR: i32 = 52 Keyboard key code: four.
KEY_FIVEconst KEY_FIVE: i32 = 53 Keyboard key code: five.
KEY_SIXconst KEY_SIX: i32 = 54 Keyboard key code: six.
KEY_SEVENconst KEY_SEVEN: i32 = 55 Keyboard key code: seven.
KEY_EIGHTconst KEY_EIGHT: i32 = 56 Keyboard key code: eight.
KEY_NINEconst KEY_NINE: i32 = 57 Keyboard key code: nine.
KEY_Aconst KEY_A: i32 = 65 Keyboard key code: a.
KEY_Bconst KEY_B: i32 = 66 Keyboard key code: b.
KEY_Cconst KEY_C: i32 = 67 Keyboard key code: c.
KEY_Dconst KEY_D: i32 = 68 Keyboard key code: d.
KEY_Econst KEY_E: i32 = 69 Keyboard key code: e.
KEY_Fconst KEY_F: i32 = 70 Keyboard key code: f.
KEY_Gconst KEY_G: i32 = 71 Keyboard key code: g.
KEY_Hconst KEY_H: i32 = 72 Keyboard key code: h.
KEY_Iconst KEY_I: i32 = 73 Keyboard key code: i.
KEY_Jconst KEY_J: i32 = 74 Keyboard key code: j.
KEY_Kconst KEY_K: i32 = 75 Keyboard key code: k.
KEY_Lconst KEY_L: i32 = 76 Keyboard key code: l.
KEY_Mconst KEY_M: i32 = 77 Keyboard key code: m.
KEY_Nconst KEY_N: i32 = 78 Keyboard key code: n.
KEY_Oconst KEY_O: i32 = 79 Keyboard key code: o.
KEY_Pconst KEY_P: i32 = 80 Keyboard key code: p.
KEY_Qconst KEY_Q: i32 = 81 Keyboard key code: q.
KEY_Rconst KEY_R: i32 = 82 Keyboard key code: r.
KEY_Sconst KEY_S: i32 = 83 Keyboard key code: s.
KEY_Tconst KEY_T: i32 = 84 Keyboard key code: t.
KEY_Uconst KEY_U: i32 = 85 Keyboard key code: u.
KEY_Vconst KEY_V: i32 = 86 Keyboard key code: v.
KEY_Wconst KEY_W: i32 = 87 Keyboard key code: w.
KEY_Xconst KEY_X: i32 = 88 Keyboard key code: x.
KEY_Yconst KEY_Y: i32 = 89 Keyboard key code: y.
KEY_Zconst KEY_Z: i32 = 90 Keyboard key code: z.
KEY_F1const KEY_F1: i32 = 290 Keyboard key code: f1.
KEY_F2const KEY_F2: i32 = 291 Keyboard key code: f2.
KEY_F3const KEY_F3: i32 = 292 Keyboard key code: f3.
KEY_F4const KEY_F4: i32 = 293 Keyboard key code: f4.
KEY_F5const KEY_F5: i32 = 294 Keyboard key code: f5.
KEY_F6const KEY_F6: i32 = 295 Keyboard key code: f6.
KEY_F7const KEY_F7: i32 = 296 Keyboard key code: f7.
KEY_F8const KEY_F8: i32 = 297 Keyboard key code: f8.
KEY_F9const KEY_F9: i32 = 298 Keyboard key code: f9.
KEY_F10const KEY_F10: i32 = 299 Keyboard key code: f10.
KEY_F11const KEY_F11: i32 = 300 Keyboard key code: f11.
KEY_F12const KEY_F12: i32 = 301 Keyboard key code: f12.
KEY_KP_0const KEY_KP_0: i32 = 320 Keyboard key code: kp 0.
KEY_KP_1const KEY_KP_1: i32 = 321 Keyboard key code: kp 1.
KEY_KP_2const KEY_KP_2: i32 = 322 Keyboard key code: kp 2.
KEY_KP_3const KEY_KP_3: i32 = 323 Keyboard key code: kp 3.
KEY_KP_4const KEY_KP_4: i32 = 324 Keyboard key code: kp 4.
KEY_KP_5const KEY_KP_5: i32 = 325 Keyboard key code: kp 5.
KEY_KP_6const KEY_KP_6: i32 = 326 Keyboard key code: kp 6.
KEY_KP_7const KEY_KP_7: i32 = 327 Keyboard key code: kp 7.
KEY_KP_8const KEY_KP_8: i32 = 328 Keyboard key code: kp 8.
KEY_KP_9const KEY_KP_9: i32 = 329 Keyboard key code: kp 9.
KEY_KP_DECIMALconst KEY_KP_DECIMAL: i32 = 330 Keyboard key code: kp decimal.
KEY_KP_DIVIDEconst KEY_KP_DIVIDE: i32 = 331 Keyboard key code: kp divide.
KEY_KP_MULTIPLYconst KEY_KP_MULTIPLY: i32 = 332 Keyboard key code: kp multiply.
KEY_KP_SUBTRACTconst KEY_KP_SUBTRACT: i32 = 333 Keyboard key code: kp subtract.
KEY_KP_ADDconst KEY_KP_ADD: i32 = 334 Keyboard key code: kp add.
KEY_KP_ENTERconst KEY_KP_ENTER: i32 = 335 Keyboard key code: kp enter.
KEY_KP_EQUALconst KEY_KP_EQUAL: i32 = 336 Keyboard key code: kp equal.
FLAG_VSYNC_HINTconst FLAG_VSYNC_HINT: u32 = 64 Window or config flag: vsync hint.
FLAG_FULLSCREEN_MODEconst FLAG_FULLSCREEN_MODE: u32 = 2 Window or config flag: fullscreen mode.
FLAG_WINDOW_RESIZABLEconst FLAG_WINDOW_RESIZABLE: u32 = 4 Window or config flag: window resizable.
FLAG_WINDOW_UNDECORATEDconst FLAG_WINDOW_UNDECORATED: u32 = 8 Window or config flag: window undecorated.
FLAG_WINDOW_HIDDENconst FLAG_WINDOW_HIDDEN: u32 = 128 Window or config flag: window hidden.
FLAG_WINDOW_MINIMIZEDconst FLAG_WINDOW_MINIMIZED: u32 = 512 Window or config flag: window minimized.
FLAG_WINDOW_MAXIMIZEDconst FLAG_WINDOW_MAXIMIZED: u32 = 1024 Window or config flag: window maximized.
FLAG_WINDOW_UNFOCUSEDconst FLAG_WINDOW_UNFOCUSED: u32 = 2048 Window or config flag: window unfocused.
FLAG_WINDOW_TOPMOSTconst FLAG_WINDOW_TOPMOST: u32 = 4096 Window or config flag: window topmost.
FLAG_WINDOW_ALWAYS_RUNconst FLAG_WINDOW_ALWAYS_RUN: u32 = 256 Window or config flag: window always run.
FLAG_WINDOW_TRANSPARENTconst FLAG_WINDOW_TRANSPARENT: u32 = 16 Window or config flag: window transparent.
FLAG_WINDOW_HIGHDPIconst FLAG_WINDOW_HIGHDPI: u32 = 8192 Window or config flag: window highdpi.
FLAG_WINDOW_MOUSE_PASSTHROUGHconst FLAG_WINDOW_MOUSE_PASSTHROUGH: u32 = 16384 Window or config flag: window mouse passthrough.
FLAG_BORDERLESS_WINDOWED_MODEconst FLAG_BORDERLESS_WINDOWED_MODE: u32 = 32768 Window or config flag: borderless windowed mode.
FLAG_MSAA_4X_HINTconst FLAG_MSAA_4X_HINT: u32 = 32 Window or config flag: msaa 4x hint.
FLAG_INTERLACED_HINTconst FLAG_INTERLACED_HINT: u32 = 65536 Window or config flag: interlaced hint.
LOG_ALLconst LOG_ALL: i32 = 0 Log level: all.
LOG_TRACEconst LOG_TRACE: i32 = 1 Log level: trace.
LOG_DEBUGconst LOG_DEBUG: i32 = 2 Log level: debug.
LOG_INFOconst LOG_INFO: i32 = 3 Log level: info.
LOG_WARNINGconst LOG_WARNING: i32 = 4 Log level: warning.
LOG_ERRORconst LOG_ERROR: i32 = 5 Log level: error.
LOG_FATALconst LOG_FATAL: i32 = 6 Log level: fatal.
LOG_NONEconst LOG_NONE: i32 = 7 Log level: none.
const MOUSE_BUTTON_LEFT: i32 = 0 Mouse: button left.
const MOUSE_BUTTON_RIGHT: i32 = 1 Mouse: button right.
const MOUSE_BUTTON_MIDDLE: i32 = 2 Mouse: button middle.
const MOUSE_BUTTON_SIDE: i32 = 3 Mouse: button side.
const MOUSE_BUTTON_EXTRA: i32 = 4 Mouse: button extra.
const MOUSE_BUTTON_FORWARD: i32 = 5 Mouse: button forward.
const MOUSE_BUTTON_BACK: i32 = 6 Mouse: button back.
MOUSE_CURSOR_DEFAULTconst MOUSE_CURSOR_DEFAULT: i32 = 0 Mouse: cursor default.
MOUSE_CURSOR_ARROWconst MOUSE_CURSOR_ARROW: i32 = 1 Mouse: cursor arrow.
MOUSE_CURSOR_IBEAMconst MOUSE_CURSOR_IBEAM: i32 = 2 Mouse: cursor ibeam.
MOUSE_CURSOR_CROSSHAIRconst MOUSE_CURSOR_CROSSHAIR: i32 = 3 Mouse: cursor crosshair.
MOUSE_CURSOR_POINTING_HANDconst MOUSE_CURSOR_POINTING_HAND: i32 = 4 Mouse: cursor pointing hand.
MOUSE_CURSOR_RESIZE_EWconst MOUSE_CURSOR_RESIZE_EW: i32 = 5 Mouse: cursor resize ew.
MOUSE_CURSOR_RESIZE_NSconst MOUSE_CURSOR_RESIZE_NS: i32 = 6 Mouse: cursor resize ns.
MOUSE_CURSOR_RESIZE_NWSEconst MOUSE_CURSOR_RESIZE_NWSE: i32 = 7 Mouse: cursor resize nwse.
MOUSE_CURSOR_RESIZE_NESWconst MOUSE_CURSOR_RESIZE_NESW: i32 = 8 Mouse: cursor resize nesw.
MOUSE_CURSOR_RESIZE_ALLconst MOUSE_CURSOR_RESIZE_ALL: i32 = 9 Mouse: cursor resize all.
MOUSE_CURSOR_NOT_ALLOWEDconst MOUSE_CURSOR_NOT_ALLOWED: i32 = 10 Mouse: cursor not allowed.
const GAMEPAD_BUTTON_UNKNOWN: i32 = 0 Gamepad: button unknown.
const GAMEPAD_BUTTON_LEFT_FACE_UP: i32 = 1 Gamepad: button left face up.
const GAMEPAD_BUTTON_LEFT_FACE_RIGHT: i32 = 2 Gamepad: button left face right.
const GAMEPAD_BUTTON_LEFT_FACE_DOWN: i32 = 3 Gamepad: button left face down.
const GAMEPAD_BUTTON_LEFT_FACE_LEFT: i32 = 4 Gamepad: button left face left.
const GAMEPAD_BUTTON_RIGHT_FACE_UP: i32 = 5 Gamepad: button right face up.
const GAMEPAD_BUTTON_RIGHT_FACE_RIGHT: i32 = 6 Gamepad: button right face right.
const GAMEPAD_BUTTON_RIGHT_FACE_DOWN: i32 = 7 Gamepad: button right face down.
const GAMEPAD_BUTTON_RIGHT_FACE_LEFT: i32 = 8 Gamepad: button right face left.
const GAMEPAD_BUTTON_LEFT_TRIGGER_1: i32 = 9 Gamepad: button left trigger 1.
const GAMEPAD_BUTTON_LEFT_TRIGGER_2: i32 = 10 Gamepad: button left trigger 2.
const GAMEPAD_BUTTON_RIGHT_TRIGGER_1: i32 = 11 Gamepad: button right trigger 1.
const GAMEPAD_BUTTON_RIGHT_TRIGGER_2: i32 = 12 Gamepad: button right trigger 2.
const GAMEPAD_BUTTON_MIDDLE_LEFT: i32 = 13 Gamepad: button middle left.
const GAMEPAD_BUTTON_MIDDLE: i32 = 14 Gamepad: button middle.
const GAMEPAD_BUTTON_MIDDLE_RIGHT: i32 = 15 Gamepad: button middle right.
const GAMEPAD_BUTTON_LEFT_THUMB: i32 = 16 Gamepad: button left thumb.
const GAMEPAD_BUTTON_RIGHT_THUMB: i32 = 17 Gamepad: button right thumb.
GAMEPAD_AXIS_LEFT_Xconst GAMEPAD_AXIS_LEFT_X: i32 = 0 Gamepad: axis left x.
GAMEPAD_AXIS_LEFT_Yconst GAMEPAD_AXIS_LEFT_Y: i32 = 1 Gamepad: axis left y.
GAMEPAD_AXIS_RIGHT_Xconst GAMEPAD_AXIS_RIGHT_X: i32 = 2 Gamepad: axis right x.
GAMEPAD_AXIS_RIGHT_Yconst GAMEPAD_AXIS_RIGHT_Y: i32 = 3 Gamepad: axis right y.
GAMEPAD_AXIS_LEFT_TRIGGERconst GAMEPAD_AXIS_LEFT_TRIGGER: i32 = 4 Gamepad: axis left trigger.
GAMEPAD_AXIS_RIGHT_TRIGGERconst GAMEPAD_AXIS_RIGHT_TRIGGER: i32 = 5 Gamepad: axis right trigger.
BLEND_ALPHAconst BLEND_ALPHA: i32 = 0 Blend mode: alpha.
BLEND_ADDITIVEconst BLEND_ADDITIVE: i32 = 1 Blend mode: additive.
BLEND_MULTIPLIEDconst BLEND_MULTIPLIED: i32 = 2 Blend mode: multiplied.
BLEND_ADD_COLORSconst BLEND_ADD_COLORS: i32 = 3 Blend mode: add colors.
BLEND_SUBTRACT_COLORSconst BLEND_SUBTRACT_COLORS: i32 = 4 Blend mode: subtract colors.
BLEND_ALPHA_PREMULTIPLYconst BLEND_ALPHA_PREMULTIPLY: i32 = 5 Blend mode: alpha premultiply.
BLEND_CUSTOMconst BLEND_CUSTOM: i32 = 6 Blend mode: custom.
TEXTURE_FILTER_POINTconst TEXTURE_FILTER_POINT: i32 = 0 Texture option: filter point.
TEXTURE_FILTER_BILINEARconst TEXTURE_FILTER_BILINEAR: i32 = 1 Texture option: filter bilinear.
TEXTURE_FILTER_TRILINEARconst TEXTURE_FILTER_TRILINEAR: i32 = 2 Texture option: filter trilinear.
TEXTURE_FILTER_ANISOTROPIC_4Xconst TEXTURE_FILTER_ANISOTROPIC_4X: i32 = 3 Texture option: filter anisotropic 4x.
TEXTURE_FILTER_ANISOTROPIC_8Xconst TEXTURE_FILTER_ANISOTROPIC_8X: i32 = 4 Texture option: filter anisotropic 8x.
TEXTURE_FILTER_ANISOTROPIC_16Xconst TEXTURE_FILTER_ANISOTROPIC_16X: i32 = 5 Texture option: filter anisotropic 16x.
TEXTURE_WRAP_REPEATconst TEXTURE_WRAP_REPEAT: i32 = 0 Texture option: wrap repeat.
TEXTURE_WRAP_CLAMPconst TEXTURE_WRAP_CLAMP: i32 = 1 Texture option: wrap clamp.
TEXTURE_WRAP_MIRROR_REPEATconst TEXTURE_WRAP_MIRROR_REPEAT: i32 = 2 Texture option: wrap mirror repeat.
TEXTURE_WRAP_MIRROR_CLAMPconst TEXTURE_WRAP_MIRROR_CLAMP: i32 = 3 Texture option: wrap mirror clamp.
CAMERA_CUSTOMconst CAMERA_CUSTOM: i32 = 0 Camera setting: custom.
CAMERA_FREEconst CAMERA_FREE: i32 = 1 Camera setting: free.
CAMERA_ORBITALconst CAMERA_ORBITAL: i32 = 2 Camera setting: orbital.
CAMERA_FIRST_PERSONconst CAMERA_FIRST_PERSON: i32 = 3 Camera setting: first person.
CAMERA_THIRD_PERSONconst CAMERA_THIRD_PERSON: i32 = 4 Camera setting: third person.
CAMERA_PERSPECTIVEconst CAMERA_PERSPECTIVE: i32 = 0 Camera setting: perspective.
CAMERA_ORTHOGRAPHICconst CAMERA_ORTHOGRAPHIC: i32 = 1 Camera setting: orthographic.
const PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: i32 = 1 Pixel format: uncompressed grayscale.
const PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: i32 = 2 Pixel format: uncompressed gray alpha.
const PIXELFORMAT_UNCOMPRESSED_R5G6B5: i32 = 3 Pixel format: uncompressed r5g6b5.
const PIXELFORMAT_UNCOMPRESSED_R8G8B8: i32 = 4 Pixel format: uncompressed r8g8b8.
const PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: i32 = 5 Pixel format: uncompressed r5g5b5a1.
const PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: i32 = 6 Pixel format: uncompressed r4g4b4a4.
const PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: i32 = 7 Pixel format: uncompressed r8g8b8a8.
const PIXELFORMAT_UNCOMPRESSED_R32: i32 = 8 Pixel format: uncompressed r32.
const PIXELFORMAT_UNCOMPRESSED_R32G32B32: i32 = 9 Pixel format: uncompressed r32g32b32.
const PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: i32 = 10 Pixel format: uncompressed r32g32b32a32.
const SHADER_UNIFORM_FLOAT: i32 = 0 Shader uniform type: uniform float.
const SHADER_UNIFORM_VEC2: i32 = 1 Shader uniform type: uniform vec2.
const SHADER_UNIFORM_VEC3: i32 = 2 Shader uniform type: uniform vec3.
const SHADER_UNIFORM_VEC4: i32 = 3 Shader uniform type: uniform vec4.
const SHADER_UNIFORM_INT: i32 = 4 Shader uniform type: uniform int.
const SHADER_UNIFORM_SAMPLER2D: i32 = 8 Shader uniform type: uniform sampler2d.
MATERIAL_MAP_ALBEDOconst MATERIAL_MAP_ALBEDO: i32 = 0 Material map slot: map albedo.
const MATERIAL_MAP_METALNESS: i32 = 1 Material map slot: map metalness.
MATERIAL_MAP_NORMALconst MATERIAL_MAP_NORMAL: i32 = 2 Material map slot: map normal.
MATERIAL_MAP_ROUGHNESSconst MATERIAL_MAP_ROUGHNESS: i32 = 3 Material map slot: map roughness.
MATERIAL_MAP_OCCLUSIONconst MATERIAL_MAP_OCCLUSION: i32 = 4 Material map slot: map occlusion.
MATERIAL_MAP_EMISSIONconst MATERIAL_MAP_EMISSION: i32 = 5 Material map slot: map emission.
GESTURE_NONEconst GESTURE_NONE: u32 = 0 Touch gesture: none.
GESTURE_TAPconst GESTURE_TAP: u32 = 1 Touch gesture: tap.
GESTURE_DOUBLETAPconst GESTURE_DOUBLETAP: u32 = 2 Touch gesture: doubletap.
GESTURE_HOLDconst GESTURE_HOLD: u32 = 4 Touch gesture: hold.
GESTURE_DRAGconst GESTURE_DRAG: u32 = 8 Touch gesture: drag.
GESTURE_SWIPE_RIGHTconst GESTURE_SWIPE_RIGHT: u32 = 16 Touch gesture: swipe right.
GESTURE_SWIPE_LEFTconst GESTURE_SWIPE_LEFT: u32 = 32 Touch gesture: swipe left.
GESTURE_SWIPE_UPconst GESTURE_SWIPE_UP: u32 = 64 Touch gesture: swipe up.
GESTURE_SWIPE_DOWNconst GESTURE_SWIPE_DOWN: u32 = 128 Touch gesture: swipe down.
GESTURE_PINCH_INconst GESTURE_PINCH_IN: u32 = 256 Touch gesture: pinch in.
GESTURE_PINCH_OUTconst GESTURE_PINCH_OUT: u32 = 512 Touch gesture: pinch out.
Functions
GetFontDefaultfunc GetFontDefault (): FontReturns font default.
LoadFontfunc LoadFont (fileName: str ): FontLoads font and returns it.
LoadFontExfunc LoadFontEx (fileName: str , fontSize: int , codepoints: int *, codepointCount: int ): FontLoads font and returns it.
LoadFontFromImagefunc LoadFontFromImage (image: Image, key: Color, firstChar: int ): FontLoads font from image and returns it.
IsFontValidfunc IsFontValid (font: Font): bool Returns true when the font loaded correctly.
UnloadFontfunc UnloadFont (font: Font)Frees a loaded font.
DrawFPSfunc DrawFPS (posX: int , posY: int )Draws FPS.
DrawTextfunc DrawText (text: str , posX: int , posY: int , fontSize: int , color: Color)Draws text.
DrawTextExfunc DrawTextEx (font: Font, text: str , position: Vector2, fontSize: f32, spacing: f32, tint: Color)Draws text.
DrawTextProfunc DrawTextPro (font: Font, text: str , position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color)Draws text.
DrawTextCodepointfunc DrawTextCodepoint (font: Font, codepoint: int , position: Vector2, fontSize: f32, tint: Color)Draws text codepoint.
SetTextLineSpacingfunc SetTextLineSpacing (spacing: int )Sets text line spacing.
MeasureTextfunc MeasureText (text: str , fontSize: int ): int Measure text.
MeasureTextExfunc MeasureTextEx (font: Font, text: str , fontSize: f32, spacing: f32): Vector2Measure text.
GetGlyphIndexfunc GetGlyphIndex (font: Font, codepoint: int ): int Returns glyph index.
TextLengthfunc TextLength (text: str ): u32Text length.
TextIsEqualfunc TextIsEqual (text1: str , text2: str ): bool Text is equal.
TextSubtextfunc TextSubtext (text: str , position: int , length: int ): str Text subtext.
TextReplacefunc TextReplace (text: str , search: str , replacement: str ): str Text replace.
TextFindIndexfunc TextFindIndex (text: str , find: str ): int Text find index.
TextToUpperfunc TextToUpper (text: str ): str Text to upper.
TextToLowerfunc TextToLower (text: str ): str Text to lower.
TextToPascalfunc TextToPascal (text: str ): str Text to pascal.
TextToSnakefunc TextToSnake (text: str ): str Text to snake.
TextToCamelfunc TextToCamel (text: str ): str Text to camel.
TextToIntegerfunc TextToInteger (text: str ): int Text to integer.
DrawTextExfunc DrawTextEx (font: Font, text: str , position: Vector2, fontSize: f64 , spacing: f64 , tint: Color)Draws text.
DrawTextProfunc DrawTextPro (font: Font, text: str , position: Vector2, origin: Vector2, rotation: f64 , fontSize: f64 , spacing: f64 , tint: Color)Draws text.
DrawTextCodepointfunc DrawTextCodepoint (font: Font, codepoint: int , position: Vector2, fontSize: f64 , tint: Color)Draws text codepoint.
MeasureTextExfunc MeasureTextEx (font: Font, text: str , fontSize: f64 , spacing: f64 ): Vector2Measure text.
InitAudioDevicefunc InitAudioDevice ()Init audio device.
CloseAudioDevicefunc CloseAudioDevice ()Close audio device.
IsAudioDeviceReadyfunc IsAudioDeviceReady (): bool Returns true when audio device ready holds.
SetMasterVolumefunc SetMasterVolume (volume: f32)Sets master volume.
GetMasterVolumefunc GetMasterVolume (): f32Returns master volume.
LoadWavefunc LoadWave (fileName: str ): WaveLoads wave and returns it.
IsWaveValidfunc IsWaveValid (wave: Wave): bool Returns true when the wave loaded correctly.
LoadSoundfunc LoadSound (fileName: str ): SoundLoads sound and returns it.
LoadSoundFromWavefunc LoadSoundFromWave (wave: Wave): SoundLoads sound from wave and returns it.
LoadSoundAliasfunc LoadSoundAlias (source: Sound): SoundLoads sound alias and returns it.
IsSoundValidfunc IsSoundValid (sound: Sound): bool Returns true when the sound loaded correctly.
UpdateSoundfunc UpdateSound (sound: Sound, data: void*, sampleCount: int )Updates sound.
UnloadWavefunc UnloadWave (wave: Wave)Frees a loaded wave.
UnloadSoundfunc UnloadSound (sound: Sound)Frees a loaded sound.
UnloadSoundAliasfunc UnloadSoundAlias (alias: Sound)Frees a loaded sound alias.
ExportWavefunc ExportWave (wave: Wave, fileName: str ): bool Export wave.
PlaySoundfunc PlaySound (sound: Sound)Play sound.
gui-raylib-PlaySound.salam Copy
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
StopSoundfunc StopSound (sound: Sound)Stop sound.
PauseSoundfunc PauseSound (sound: Sound)Pause sound.
ResumeSoundfunc ResumeSound (sound: Sound)Resume sound.
IsSoundPlayingfunc IsSoundPlaying (sound: Sound): bool Returns true when sound playing holds.
SetSoundVolumefunc SetSoundVolume (sound: Sound, volume: f32)Sets sound volume.
SetSoundPitchfunc SetSoundPitch (sound: Sound, pitch: f32)Sets sound pitch.
SetSoundPanfunc SetSoundPan (sound: Sound, pan: f32)Sets sound pan.
WaveCopyfunc WaveCopy (wave: Wave): WaveWave copy.
WaveCropfunc WaveCrop (wave &: Wave, initFrame: int , finalFrame: int )Wave crop.
func WaveFormat (wave &: Wave, sampleRate: int , sampleSize: int , channels: int )Wave format.
LoadWaveSamplesfunc LoadWaveSamples (wave: Wave): f32*Loads wave samples and returns it.
UnloadWaveSamplesfunc UnloadWaveSamples (samples: f32*)Frees a loaded wave samples.
LoadMusicStreamfunc LoadMusicStream (fileName: str ): MusicLoads music stream and returns it.
IsMusicValidfunc IsMusicValid (music: Music): bool Returns true when the music loaded correctly.
UnloadMusicStreamfunc UnloadMusicStream (music: Music)Frees a loaded music stream.
PlayMusicStreamfunc PlayMusicStream (music: Music)Play music stream.
IsMusicStreamPlayingfunc IsMusicStreamPlaying (music: Music): bool Returns true when music stream playing holds.
UpdateMusicStreamfunc UpdateMusicStream (music: Music)Updates music stream.
StopMusicStreamfunc StopMusicStream (music: Music)Stop music stream.
PauseMusicStreamfunc PauseMusicStream (music: Music)Pause music stream.
ResumeMusicStreamfunc ResumeMusicStream (music: Music)Resume music stream.
SeekMusicStreamfunc SeekMusicStream (music: Music, position: f32)Seek music stream.
SetMusicVolumefunc SetMusicVolume (music: Music, volume: f32)Sets music volume.
SetMusicPitchfunc SetMusicPitch (music: Music, pitch: f32)Sets music pitch.
SetMusicPanfunc SetMusicPan (music: Music, pan: f32)Sets music pan.
GetMusicTimeLengthfunc GetMusicTimeLength (music: Music): f32Returns music time length.
GetMusicTimePlayedfunc GetMusicTimePlayed (music: Music): f32Returns music time played.
SetMasterVolumefunc SetMasterVolume (volume: f64 )Sets master volume.
SetSoundVolumefunc SetSoundVolume (sound: Sound, volume: f64 )Sets sound volume.
SetSoundPitchfunc SetSoundPitch (sound: Sound, pitch: f64 )Sets sound pitch.
SetSoundPanfunc SetSoundPan (sound: Sound, pan: f64 )Sets sound pan.
SeekMusicStreamfunc SeekMusicStream (music: Music, position: f64 )Seek music stream.
SetMusicVolumefunc SetMusicVolume (music: Music, volume: f64 )Sets music volume.
SetMusicPitchfunc SetMusicPitch (music: Music, pitch: f64 )Sets music pitch.
SetMusicPanfunc SetMusicPan (music: Music, pan: f64 )Sets music pan.
IsKeyPressedfunc IsKeyPressed (key: int ): bool Returns true when the key is pressed this frame.
IsKeyPressedRepeatfunc IsKeyPressedRepeat (key: int ): bool Returns true when the key is pressed again by key repeat.
IsKeyDownfunc IsKeyDown (key: int ): bool Returns true when the key is held down.
gui-raylib-IsKeyDown.salam Copy
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
IsKeyReleasedfunc IsKeyReleased (key: int ): bool Returns true when the key is released this frame.
IsKeyUpfunc IsKeyUp (key: int ): bool Returns true when the key is not held.
GetKeyPressedfunc GetKeyPressed (): int Returns key pressed.
GetCharPressedfunc GetCharPressed (): int Returns char pressed.
SetExitKeyfunc SetExitKey (key: int )Sets exit key.
IsGamepadAvailablefunc IsGamepadAvailable (gamepad: int ): bool Returns true when gamepad available holds.
GetGamepadNamefunc GetGamepadName (gamepad: int ): str Returns gamepad name.
func IsGamepadButtonPressed (gamepad: int , button: int ): bool Returns true when the gamepad button is pressed this frame.
func IsGamepadButtonDown (gamepad: int , button: int ): bool Returns true when the gamepad button is held down.
func IsGamepadButtonReleased (gamepad: int , button: int ): bool Returns true when the gamepad button is released this frame.
func IsGamepadButtonUp (gamepad: int , button: int ): bool Returns true when the gamepad button is not held.
func GetGamepadButtonPressed (): int Returns gamepad button pressed.
GetGamepadAxisCountfunc GetGamepadAxisCount (gamepad: int ): int Returns gamepad axis count.
GetGamepadAxisMovementfunc GetGamepadAxisMovement (gamepad: int , axis: int ): f32Returns gamepad axis movement.
SetGamepadMappingsfunc SetGamepadMappings (mappings: str ): int Sets gamepad mappings.
SetGamepadVibrationfunc SetGamepadVibration (gamepad: int , leftMotor: f32, rightMotor: f32, duration: f32)Sets gamepad vibration.
func IsMouseButtonPressed (button: int ): bool Returns true when the mouse button is pressed this frame.
func IsMouseButtonDown (button: int ): bool Returns true when the mouse button is held down.
func IsMouseButtonReleased (button: int ): bool Returns true when the mouse button is released this frame.
func IsMouseButtonUp (button: int ): bool Returns true when the mouse button is not held.
GetMouseXfunc GetMouseX (): int Returns mouse x.
GetMouseYfunc GetMouseY (): int Returns mouse y.
GetMousePositionfunc GetMousePosition (): Vector2Returns mouse position.
GetMouseDeltafunc GetMouseDelta (): Vector2Returns mouse delta.
SetMousePositionfunc SetMousePosition (x: int , y: int )Sets mouse position.
SetMouseOffsetfunc SetMouseOffset (offsetX: int , offsetY: int )Sets mouse offset.
SetMouseScalefunc SetMouseScale (scaleX: f32, scaleY: f32)Sets mouse scale.
GetMouseWheelMovefunc GetMouseWheelMove (): f32Returns mouse wheel move.
GetMouseWheelMoveVfunc GetMouseWheelMoveV (): Vector2Returns mouse wheel move.
SetMouseCursorfunc SetMouseCursor (cursor: int )Sets mouse cursor.
GetTouchXfunc GetTouchX (): int Returns touch x.
GetTouchYfunc GetTouchY (): int Returns touch y.
GetTouchPositionfunc GetTouchPosition (index: int ): Vector2Returns touch position.
GetTouchPointIdfunc GetTouchPointId (index: int ): int Returns touch point id.
GetTouchPointCountfunc GetTouchPointCount (): int Returns touch point count.
SetGesturesEnabledfunc SetGesturesEnabled (flags: u32)Sets gestures enabled.
IsGestureDetectedfunc IsGestureDetected (gesture: u32): bool Returns true when gesture detected holds.
GetGestureDetectedfunc GetGestureDetected (): int Returns gesture detected.
GetGestureHoldDurationfunc GetGestureHoldDuration (): f32Returns gesture hold duration.
GetGestureDragVectorfunc GetGestureDragVector (): Vector2Returns gesture drag vector.
GetGestureDragAnglefunc GetGestureDragAngle (): f32Returns gesture drag angle.
GetGesturePinchVectorfunc GetGesturePinchVector (): Vector2Returns gesture pinch vector.
GetGesturePinchAnglefunc GetGesturePinchAngle (): f32Returns gesture pinch angle.
UpdateCamerafunc UpdateCamera (camera &: Camera3D, mode: int )Updates camera.
UpdateCameraProfunc UpdateCameraPro (camera &: Camera3D, movement: Vector3, rotation: Vector3, zoom: f32)Updates camera.
SetGamepadVibrationfunc SetGamepadVibration (gamepad: int , leftMotor: f64 , rightMotor: f64 , duration: f64 )Sets gamepad vibration.
SetMouseScalefunc SetMouseScale (scaleX: f64 , scaleY: f64 )Sets mouse scale.
UpdateCameraProfunc UpdateCameraPro (camera &: Camera3D, movement: Vector3, rotation: Vector3, zoom: f64 )Updates camera.
InitWindowfunc InitWindow (width: int , height: int , title: str )Init window.
gui-raylib-InitWindow.salam Copy
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
CloseWindowfunc CloseWindow ()Close window.
WindowShouldClosefunc WindowShouldClose (): bool Window should close.
IsWindowReadyfunc IsWindowReady (): bool Returns true when the window is ready.
IsWindowFullscreenfunc IsWindowFullscreen (): bool Returns true when the window is fullscreen.
IsWindowHiddenfunc IsWindowHidden (): bool Returns true when the window is hidden.
IsWindowMinimizedfunc IsWindowMinimized (): bool Returns true when the window is minimized.
IsWindowMaximizedfunc IsWindowMaximized (): bool Returns true when the window is maximized.
IsWindowFocusedfunc IsWindowFocused (): bool Returns true when the window is focused.
IsWindowResizedfunc IsWindowResized (): bool Returns true when the window is resized.
IsWindowStatefunc IsWindowState (flag: u32): bool Returns true when the window has the given state flag.
SetWindowStatefunc SetWindowState (flags: u32)Turns on window state flags.
ClearWindowStatefunc ClearWindowState (flags: u32)Turns off window state flags.
ToggleFullscreenfunc ToggleFullscreen ()Toggle fullscreen.
ToggleBorderlessWindowedfunc ToggleBorderlessWindowed ()Toggle borderless windowed.
MaximizeWindowfunc MaximizeWindow ()Maximize window.
MinimizeWindowfunc MinimizeWindow ()Minimize window.
RestoreWindowfunc RestoreWindow ()Restore window.
SetWindowIconfunc SetWindowIcon (image: Image)Sets window icon.
SetWindowTitlefunc SetWindowTitle (title: str )Sets window title.
SetWindowPositionfunc SetWindowPosition (x: int , y: int )Sets window position.
SetWindowMonitorfunc SetWindowMonitor (monitor: int )Sets window monitor.
SetWindowMinSizefunc SetWindowMinSize (width: int , height: int )Sets window min size.
SetWindowMaxSizefunc SetWindowMaxSize (width: int , height: int )Sets window max size.
SetWindowSizefunc SetWindowSize (width: int , height: int )Sets window size.
SetWindowOpacityfunc SetWindowOpacity (opacity: f32)Sets window opacity.
SetWindowFocusedfunc SetWindowFocused ()Sets window focused.
GetScreenWidthfunc GetScreenWidth (): int Returns screen width.
GetScreenHeightfunc GetScreenHeight (): int Returns screen height.
GetRenderWidthfunc GetRenderWidth (): int Returns render width.
GetRenderHeightfunc GetRenderHeight (): int Returns render height.
GetMonitorCountfunc GetMonitorCount (): int Returns monitor count.
GetCurrentMonitorfunc GetCurrentMonitor (): int Returns current monitor.
GetMonitorPositionfunc GetMonitorPosition (monitor: int ): Vector2Returns monitor position.
GetMonitorWidthfunc GetMonitorWidth (monitor: int ): int Returns monitor width.
GetMonitorHeightfunc GetMonitorHeight (monitor: int ): int Returns monitor height.
GetMonitorPhysicalWidthfunc GetMonitorPhysicalWidth (monitor: int ): int Returns monitor physical width.
GetMonitorPhysicalHeightfunc GetMonitorPhysicalHeight (monitor: int ): int Returns monitor physical height.
GetMonitorRefreshRatefunc GetMonitorRefreshRate (monitor: int ): int Returns monitor refresh rate.
GetWindowPositionfunc GetWindowPosition (): Vector2Returns window position.
GetWindowScaleDPIfunc GetWindowScaleDPI (): Vector2Returns window scale DPI.
GetMonitorNamefunc GetMonitorName (monitor: int ): str Returns monitor name.
SetClipboardTextfunc SetClipboardText (text: str )Sets clipboard text.
GetClipboardTextfunc GetClipboardText (): str Returns clipboard text.
EnableEventWaitingfunc EnableEventWaiting ()Enable event waiting.
DisableEventWaitingfunc DisableEventWaiting ()Disable event waiting.
ShowCursorfunc ShowCursor ()Show cursor.
HideCursorfunc HideCursor ()Hide cursor.
IsCursorHiddenfunc IsCursorHidden (): bool Returns true when cursor hidden holds.
EnableCursorfunc EnableCursor ()Enable cursor.
DisableCursorfunc DisableCursor ()Disable cursor.
IsCursorOnScreenfunc IsCursorOnScreen (): bool Returns true when cursor on screen holds.
ClearBackgroundfunc ClearBackground (color: Color)Clear background.
BeginDrawingfunc BeginDrawing ()Starts drawing mode; end it with the matching End call.
EndDrawingfunc EndDrawing ()Ends drawing mode.
BeginMode2Dfunc BeginMode2D (camera: Camera2D)Starts 2D mode; end it with the matching End call.
EndMode2Dfunc EndMode2D ()Ends 2D mode.
BeginMode3Dfunc BeginMode3D (camera: Camera3D)Starts 3D mode; end it with the matching End call.
EndMode3Dfunc EndMode3D ()Ends 3D mode.
BeginTextureModefunc BeginTextureMode (target: RenderTexture)Starts texture mode; end it with the matching End call.
EndTextureModefunc EndTextureMode ()Ends texture mode.
BeginShaderModefunc BeginShaderMode (shader: Shader)Starts shader mode; end it with the matching End call.
EndShaderModefunc EndShaderMode ()Ends shader mode.
BeginBlendModefunc BeginBlendMode (mode: int )Starts blend mode; end it with the matching End call.
EndBlendModefunc EndBlendMode ()Ends blend mode.
BeginScissorModefunc BeginScissorMode (x: int , y: int , width: int , height: int )Starts scissor mode; end it with the matching End call.
EndScissorModefunc EndScissorMode ()Ends scissor mode.
LoadShaderfunc LoadShader (vsFileName: str , fsFileName: str ): ShaderLoads shader and returns it.
LoadShaderFromMemoryfunc LoadShaderFromMemory (vsCode: str , fsCode: str ): ShaderLoads shader from memory and returns it.
IsShaderValidfunc IsShaderValid (shader: Shader): bool Returns true when the shader loaded correctly.
GetShaderLocationfunc GetShaderLocation (shader: Shader, uniformName: str ): int Returns shader location.
GetShaderLocationAttribfunc GetShaderLocationAttrib (shader: Shader, attribName: str ): int Returns shader location attrib.
SetShaderValuefunc SetShaderValue (shader: Shader, locIndex: int , value: void*, uniformType: int )Sets shader value.
SetShaderValueVfunc SetShaderValueV (shader: Shader, locIndex: int , value: void*, uniformType: int , count: int )Sets shader value.
SetShaderValueMatrixfunc SetShaderValueMatrix (shader: Shader, locIndex: int , mat: Matrix)Sets shader value matrix.
SetShaderValueTexturefunc SetShaderValueTexture (shader: Shader, locIndex: int , texture: Texture)Sets shader value texture.
UnloadShaderfunc UnloadShader (shader: Shader)Frees a loaded shader.
GetScreenToWorldRayfunc GetScreenToWorldRay (position: Vector2, camera: Camera3D): RayReturns screen to world ray.
GetScreenToWorldRayExfunc GetScreenToWorldRayEx (position: Vector2, camera: Camera3D, width: int , height: int ): RayReturns screen to world ray.
GetWorldToScreenfunc GetWorldToScreen (position: Vector3, camera: Camera3D): Vector2Returns world to screen.
GetWorldToScreenExfunc GetWorldToScreenEx (position: Vector3, camera: Camera3D, width: int , height: int ): Vector2Returns world to screen.
GetWorldToScreen2Dfunc GetWorldToScreen2D (position: Vector2, camera: Camera2D): Vector2Returns world to screen 2D.
GetScreenToWorld2Dfunc GetScreenToWorld2D (position: Vector2, camera: Camera2D): Vector2Returns screen to world 2D.
GetCameraMatrixfunc GetCameraMatrix (camera: Camera3D): MatrixReturns camera matrix.
GetCameraMatrix2Dfunc GetCameraMatrix2D (camera: Camera2D): MatrixReturns camera matrix 2D.
SetTargetFPSfunc SetTargetFPS (fps: int )Sets target FPS.
GetFrameTimefunc GetFrameTime (): f32Returns frame time.
GetTimefunc GetTime (): f64 Returns time.
GetFPSfunc GetFPS (): int Returns FPS.
SwapScreenBufferfunc SwapScreenBuffer ()Swap screen buffer.
func PollInputEvents ()Poll input events.
WaitTimefunc WaitTime (seconds: f64 )Wait time.
SetRandomSeedfunc SetRandomSeed (seed: u32)Sets random seed.
GetRandomValuefunc GetRandomValue (min: int , max: int ): int Returns random value.
TakeScreenshotfunc TakeScreenshot (fileName: str )Take screenshot.
SetConfigFlagsfunc SetConfigFlags (flags: u32)Sets config flags.
OpenURLfunc OpenURL (url: str )Open URL.
SetTraceLogLevelfunc SetTraceLogLevel (logLevel: int )Sets trace log level.
MemAllocfunc MemAlloc (size: u32): void*Mem alloc.
MemFreefunc MemFree (ptr: void*)Mem free.
FileExistsfunc FileExists (fileName: str ): bool File exists.
DirectoryExistsfunc DirectoryExists (dirPath: str ): bool Directory exists.
IsFileExtensionfunc IsFileExtension (fileName: str , ext: str ): bool Returns true when file extension holds.
GetFileLengthfunc GetFileLength (fileName: str ): int Returns file length.
GetFileExtensionfunc GetFileExtension (fileName: str ): str Returns file extension.
GetFileNamefunc GetFileName (filePath: str ): str Returns file name.
GetFileNameWithoutExtfunc GetFileNameWithoutExt (filePath: str ): str Returns file name without ext.
GetDirectoryPathfunc GetDirectoryPath (filePath: str ): str Returns directory path.
GetPrevDirectoryPathfunc GetPrevDirectoryPath (dirPath: str ): str Returns prev directory path.
GetWorkingDirectoryfunc GetWorkingDirectory (): str Returns working directory.
GetApplicationDirectoryfunc GetApplicationDirectory (): str Returns application directory.
ChangeDirectoryfunc ChangeDirectory (dir: str ): bool Change directory.
IsPathFilefunc IsPathFile (path: str ): bool Returns true when path file holds.
IsFileNameValidfunc IsFileNameValid (fileName: str ): bool Returns true when the file name loaded correctly.
LoadDirectoryFilesfunc LoadDirectoryFiles (dirPath: str ): FilePathListLoads directory files and returns it.
UnloadDirectoryFilesfunc UnloadDirectoryFiles (files: FilePathList)Frees a loaded directory files.
IsFileDroppedfunc IsFileDropped (): bool Returns true when file dropped holds.
LoadDroppedFilesfunc LoadDroppedFiles (): FilePathListLoads dropped files and returns it.
UnloadDroppedFilesfunc UnloadDroppedFiles (files: FilePathList)Frees a loaded dropped files.
LoadFileTextfunc LoadFileText (fileName: str ): str Loads file text and returns it.
UnloadFileTextfunc UnloadFileText (text: str )Frees a loaded file text.
SaveFileTextfunc SaveFileText (fileName: str , text: str ): bool Save file text.
LoadFileDatafunc LoadFileData (fileName: str , dataSize &: int ): u8*Loads file data and returns it.
UnloadFileDatafunc UnloadFileData (data: u8*)Frees a loaded file data.
SaveFileDatafunc SaveFileData (fileName: str , data: void*, dataSize: int ): bool Save file data.
SetWindowOpacityfunc SetWindowOpacity (opacity: f64 )Sets window opacity.
DrawLine3Dfunc DrawLine3D (startPos: Vector3, endPos: Vector3, color: Color)Draws line 3D.
DrawPoint3Dfunc DrawPoint3D (position: Vector3, color: Color)Draws point 3D.
DrawCircle3Dfunc DrawCircle3D (center: Vector3, radius: f32, rotationAxis: Vector3, rotationAngle: f32, color: Color)Draws circle 3D.
DrawTriangle3Dfunc DrawTriangle3D (v1: Vector3, v2: Vector3, v3: Vector3, color: Color)Draws triangle 3D.
DrawTriangleStrip3Dfunc DrawTriangleStrip3D (points: Vector3*, pointCount: int , color: Color)Draws triangle strip 3D.
DrawCubefunc DrawCube (position: Vector3, width: f32, height: f32, length: f32, color: Color)Draws cube.
DrawCubeVfunc DrawCubeV (position: Vector3, size: Vector3, color: Color)Draws cube.
DrawCubeWiresfunc DrawCubeWires (position: Vector3, width: f32, height: f32, length: f32, color: Color)Draws cube wires.
DrawCubeWiresVfunc DrawCubeWiresV (position: Vector3, size: Vector3, color: Color)Draws cube wires.
DrawSpherefunc DrawSphere (centerPos: Vector3, radius: f32, color: Color)Draws sphere.
DrawSphereExfunc DrawSphereEx (centerPos: Vector3, radius: f32, rings: int , slices: int , color: Color)Draws sphere.
DrawSphereWiresfunc DrawSphereWires (centerPos: Vector3, radius: f32, rings: int , slices: int , color: Color)Draws sphere wires.
DrawCylinderfunc DrawCylinder (position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: int , color: Color)Draws cylinder.
DrawCylinderExfunc DrawCylinderEx (startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: int , color: Color)Draws cylinder.
DrawCylinderWiresfunc DrawCylinderWires (position: Vector3, radiusTop: f32, radiusBottom: f32, height: f32, slices: int , color: Color)Draws cylinder wires.
DrawCylinderWiresExfunc DrawCylinderWiresEx (startPos: Vector3, endPos: Vector3, startRadius: f32, endRadius: f32, sides: int , color: Color)Draws cylinder wires.
DrawCapsulefunc DrawCapsule (startPos: Vector3, endPos: Vector3, radius: f32, slices: int , rings: int , color: Color)Draws capsule.
DrawCapsuleWiresfunc DrawCapsuleWires (startPos: Vector3, endPos: Vector3, radius: f32, slices: int , rings: int , color: Color)Draws capsule wires.
DrawPlanefunc DrawPlane (centerPos: Vector3, size: Vector2, color: Color)Draws plane.
DrawRayfunc DrawRay (ray: Ray, color: Color)Draws ray.
DrawGridfunc DrawGrid (slices: int , spacing: f32)Draws grid.
LoadModelfunc LoadModel (fileName: str ): ModelLoads model and returns it.
LoadModelFromMeshfunc LoadModelFromMesh (mesh: Mesh): ModelLoads model from mesh and returns it.
IsModelValidfunc IsModelValid (model: Model): bool Returns true when the model loaded correctly.
UnloadModelfunc UnloadModel (model: Model)Frees a loaded model.
GetModelBoundingBoxfunc GetModelBoundingBox (model: Model): BoundingBoxReturns model bounding box.
DrawModelfunc DrawModel (model: Model, position: Vector3, scale: f32, tint: Color)Draws model.
DrawModelExfunc DrawModelEx (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color)Draws model.
DrawModelWiresfunc DrawModelWires (model: Model, position: Vector3, scale: f32, tint: Color)Draws model wires.
DrawModelWiresExfunc DrawModelWiresEx (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f32, scale: Vector3, tint: Color)Draws model wires.
DrawBoundingBoxfunc DrawBoundingBox (box: BoundingBox, color: Color)Draws bounding box.
DrawBillboardfunc DrawBillboard (camera: Camera3D, texture: Texture, position: Vector3, scale: f32, tint: Color)Draws billboard.
DrawBillboardRecfunc DrawBillboardRec (camera: Camera3D, texture: Texture, source: Rectangle, position: Vector3, size: Vector2, tint: Color)Draws billboard rectangle.
UploadMeshfunc UploadMesh (mesh &: Mesh, dynamic: bool )Upload mesh.
UnloadMeshfunc UnloadMesh (mesh: Mesh)Frees a loaded mesh.
DrawMeshfunc DrawMesh (mesh: Mesh, material: Material, transform: Matrix)Draws mesh.
GetMeshBoundingBoxfunc GetMeshBoundingBox (mesh: Mesh): BoundingBoxReturns mesh bounding box.
GenMeshTangentsfunc GenMeshTangents (mesh &: Mesh)Generates mesh tangents.
ExportMeshfunc ExportMesh (mesh: Mesh, fileName: str ): bool Export mesh.
GenMeshPolyfunc GenMeshPoly (sides: int , radius: f32): MeshGenerates mesh poly.
GenMeshPlanefunc GenMeshPlane (width: f32, length: f32, resX: int , resZ: int ): MeshGenerates mesh plane.
GenMeshCubefunc GenMeshCube (width: f32, height: f32, length: f32): MeshGenerates mesh cube.
GenMeshSpherefunc GenMeshSphere (radius: f32, rings: int , slices: int ): MeshGenerates mesh sphere.
GenMeshHemiSpherefunc GenMeshHemiSphere (radius: f32, rings: int , slices: int ): MeshGenerates mesh hemi sphere.
GenMeshCylinderfunc GenMeshCylinder (radius: f32, height: f32, slices: int ): MeshGenerates mesh cylinder.
GenMeshConefunc GenMeshCone (radius: f32, height: f32, slices: int ): MeshGenerates mesh cone.
GenMeshTorusfunc GenMeshTorus (radius: f32, size: f32, radSeg: int , sides: int ): MeshGenerates mesh torus.
GenMeshKnotfunc GenMeshKnot (radius: f32, size: f32, radSeg: int , sides: int ): MeshGenerates mesh knot.
GenMeshHeightmapfunc GenMeshHeightmap (heightmap: Image, size: Vector3): MeshGenerates mesh heightmap.
GenMeshCubicmapfunc GenMeshCubicmap (cubicmap: Image, cubeSize: Vector3): MeshGenerates mesh cubicmap.
LoadMaterialDefaultfunc LoadMaterialDefault (): MaterialLoads material default and returns it.
IsMaterialValidfunc IsMaterialValid (material: Material): bool Returns true when the material loaded correctly.
UnloadMaterialfunc UnloadMaterial (material: Material)Frees a loaded material.
SetMaterialTexturefunc SetMaterialTexture (material &: Material, mapType: int , texture: Texture)Sets material texture.
SetModelMeshMaterialfunc SetModelMeshMaterial (model &: Model, meshId: int , materialId: int )Sets model mesh material.
LoadModelAnimationsfunc LoadModelAnimations (fileName: str , animCount &: int ): ModelAnimation*Loads model animations and returns it.
UpdateModelAnimationfunc UpdateModelAnimation (model: Model, anim: ModelAnimation, frame: int )Updates model animation.
UnloadModelAnimationfunc UnloadModelAnimation (anim: ModelAnimation)Frees a loaded model animation.
UnloadModelAnimationsfunc UnloadModelAnimations (animations: ModelAnimation*, animCount: int )Frees a loaded model animations.
IsModelAnimationValidfunc IsModelAnimationValid (model: Model, anim: ModelAnimation): bool Returns true when the model animation loaded correctly.
CheckCollisionSpheresfunc CheckCollisionSpheres (center1: Vector3, radius1: f32, center2: Vector3, radius2: f32): bool Returns true when the shapes (spheres) collide.
CheckCollisionBoxesfunc CheckCollisionBoxes (box1: BoundingBox, box2: BoundingBox): bool Returns true when the shapes (boxes) collide.
CheckCollisionBoxSpherefunc CheckCollisionBoxSphere (box: BoundingBox, center: Vector3, radius: f32): bool Returns true when the shapes (box sphere) collide.
GetRayCollisionSpherefunc GetRayCollisionSphere (ray: Ray, center: Vector3, radius: f32): RayCollisionReturns ray collision sphere.
GetRayCollisionBoxfunc GetRayCollisionBox (ray: Ray, box: BoundingBox): RayCollisionReturns ray collision box.
GetRayCollisionMeshfunc GetRayCollisionMesh (ray: Ray, mesh: Mesh, transform: Matrix): RayCollisionReturns ray collision mesh.
GetRayCollisionTrianglefunc GetRayCollisionTriangle (ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3): RayCollisionReturns ray collision triangle.
GetRayCollisionQuadfunc GetRayCollisionQuad (ray: Ray, p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3): RayCollisionReturns ray collision quad.
DrawCircle3Dfunc DrawCircle3D (center: Vector3, radius: f64 , rotationAxis: Vector3, rotationAngle: f64 , color: Color)Draws circle 3D.
DrawCubefunc DrawCube (position: Vector3, width: f64 , height: f64 , length: f64 , color: Color)Draws cube.
DrawCubeWiresfunc DrawCubeWires (position: Vector3, width: f64 , height: f64 , length: f64 , color: Color)Draws cube wires.
DrawSpherefunc DrawSphere (centerPos: Vector3, radius: f64 , color: Color)Draws sphere.
DrawSphereExfunc DrawSphereEx (centerPos: Vector3, radius: f64 , rings: int , slices: int , color: Color)Draws sphere.
DrawSphereWiresfunc DrawSphereWires (centerPos: Vector3, radius: f64 , rings: int , slices: int , color: Color)Draws sphere wires.
DrawCylinderfunc DrawCylinder (position: Vector3, radiusTop: f64 , radiusBottom: f64 , height: f64 , slices: int , color: Color)Draws cylinder.
DrawCylinderExfunc DrawCylinderEx (startPos: Vector3, endPos: Vector3, startRadius: f64 , endRadius: f64 , sides: int , color: Color)Draws cylinder.
DrawCylinderWiresfunc DrawCylinderWires (position: Vector3, radiusTop: f64 , radiusBottom: f64 , height: f64 , slices: int , color: Color)Draws cylinder wires.
DrawCylinderWiresExfunc DrawCylinderWiresEx (startPos: Vector3, endPos: Vector3, startRadius: f64 , endRadius: f64 , sides: int , color: Color)Draws cylinder wires.
DrawCapsulefunc DrawCapsule (startPos: Vector3, endPos: Vector3, radius: f64 , slices: int , rings: int , color: Color)Draws capsule.
DrawCapsuleWiresfunc DrawCapsuleWires (startPos: Vector3, endPos: Vector3, radius: f64 , slices: int , rings: int , color: Color)Draws capsule wires.
DrawGridfunc DrawGrid (slices: int , spacing: f64 )Draws grid.
DrawModelfunc DrawModel (model: Model, position: Vector3, scale: f64 , tint: Color)Draws model.
DrawModelExfunc DrawModelEx (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f64 , scale: Vector3, tint: Color)Draws model.
DrawModelWiresfunc DrawModelWires (model: Model, position: Vector3, scale: f64 , tint: Color)Draws model wires.
DrawModelWiresExfunc DrawModelWiresEx (model: Model, position: Vector3, rotationAxis: Vector3, rotationAngle: f64 , scale: Vector3, tint: Color)Draws model wires.
DrawBillboardfunc DrawBillboard (camera: Camera3D, texture: Texture, position: Vector3, scale: f64 , tint: Color)Draws billboard.
GenMeshPolyfunc GenMeshPoly (sides: int , radius: f64 ): MeshGenerates mesh poly.
GenMeshPlanefunc GenMeshPlane (width: f64 , length: f64 , resX: int , resZ: int ): MeshGenerates mesh plane.
GenMeshCubefunc GenMeshCube (width: f64 , height: f64 , length: f64 ): MeshGenerates mesh cube.
GenMeshSpherefunc GenMeshSphere (radius: f64 , rings: int , slices: int ): MeshGenerates mesh sphere.
GenMeshHemiSpherefunc GenMeshHemiSphere (radius: f64 , rings: int , slices: int ): MeshGenerates mesh hemi sphere.
GenMeshCylinderfunc GenMeshCylinder (radius: f64 , height: f64 , slices: int ): MeshGenerates mesh cylinder.
GenMeshConefunc GenMeshCone (radius: f64 , height: f64 , slices: int ): MeshGenerates mesh cone.
GenMeshTorusfunc GenMeshTorus (radius: f64 , size: f64 , radSeg: int , sides: int ): MeshGenerates mesh torus.
GenMeshKnotfunc GenMeshKnot (radius: f64 , size: f64 , radSeg: int , sides: int ): MeshGenerates mesh knot.
CheckCollisionSpheresfunc CheckCollisionSpheres (center1: Vector3, radius1: f64 , center2: Vector3, radius2: f64 ): bool Returns true when the shapes (spheres) collide.
CheckCollisionBoxSpherefunc CheckCollisionBoxSphere (box: BoundingBox, center: Vector3, radius: f64 ): bool Returns true when the shapes (box sphere) collide.
GetRayCollisionSpherefunc GetRayCollisionSphere (ray: Ray, center: Vector3, radius: f64 ): RayCollisionReturns ray collision sphere.
Vec2func Vec2 (x: f64 , y: f64 ): Vector2Builds a Vector2 from f64 values.
Vec3func Vec3 (x: f64 , y: f64 , z: f64 ): Vector3Builds a Vector3 from f64 values.
Vec4func Vec4 (x: f64 , y: f64 , z: f64 , w: f64 ): Vector4Builds a Vector4 from f64 values.
Rectfunc Rect (x: f64 , y: f64 , width: f64 , height: f64 ): RectangleBuilds a Rectangle from f64 values.
RGBfunc RGB (r: int , g: int , b: int ): ColorBuilds an opaque Color from red, green and blue values.
RGBAfunc RGBA (r: int , g: int , b: int , a: int ): ColorBuilds a Color from red, green, blue and alpha values.
NewCamera2Dfunc NewCamera2D (offset: Vector2, target: Vector2, rotation: f64 , zoom: f64 ): Camera2DBuilds a Camera2D from f64 values.
NewCamera3Dfunc NewCamera3D (position: Vector3, target: Vector3, up: Vector3, fovy: f64 , projection: int ): Camera3DBuilds a Camera3D from f64 values.
LightGrayfunc LightGray (): ColorThe raylib LightGray color.
Grayfunc Gray (): ColorThe raylib Gray color.
DarkGrayfunc DarkGray (): ColorThe raylib DarkGray color.
Yellowfunc Yellow (): ColorThe raylib Yellow color.
Goldfunc Gold (): ColorThe raylib Gold color.
Orangefunc Orange (): ColorThe raylib Orange color.
Pinkfunc Pink (): ColorThe raylib Pink color.
Redfunc Red (): ColorThe raylib Red color.
Maroonfunc Maroon (): ColorThe raylib Maroon color.
Greenfunc Green (): ColorThe raylib Green color.
Limefunc Lime (): ColorThe raylib Lime color.
DarkGreenfunc DarkGreen (): ColorThe raylib DarkGreen color.
SkyBluefunc SkyBlue (): ColorThe raylib SkyBlue color.
Bluefunc Blue (): ColorThe raylib Blue color.
DarkBluefunc DarkBlue (): ColorThe raylib DarkBlue color.
Purplefunc Purple (): ColorThe raylib Purple color.
Violetfunc Violet (): ColorThe raylib Violet color.
DarkPurplefunc DarkPurple (): ColorThe raylib DarkPurple color.
Beigefunc Beige (): ColorThe raylib Beige color.
Brownfunc Brown (): ColorThe raylib Brown color.
DarkBrownfunc DarkBrown (): ColorThe raylib DarkBrown color.
Whitefunc White (): ColorThe raylib White color.
Blackfunc Black (): ColorThe raylib Black color.
Blankfunc Blank (): ColorThe raylib Blank color.
Magentafunc Magenta (): ColorThe raylib Magenta color.
RayWhitefunc RayWhite (): ColorThe raylib RayWhite color.
LoadImagefunc LoadImage (fileName: str ): ImageLoads image and returns it.
LoadImageRawfunc LoadImageRaw (fileName: str , width: int , height: int , format: int , headerSize: int ): ImageLoads image raw and returns it.
LoadImageFromMemoryfunc LoadImageFromMemory (fileType: str , fileData: u8*, dataSize: int ): ImageLoads image from memory and returns it.
LoadImageFromTexturefunc LoadImageFromTexture (texture: Texture): ImageLoads image from texture and returns it.
LoadImageFromScreenfunc LoadImageFromScreen (): ImageLoads image from screen and returns it.
IsImageValidfunc IsImageValid (image: Image): bool Returns true when the image loaded correctly.
UnloadImagefunc UnloadImage (image: Image)Frees a loaded image.
ExportImagefunc ExportImage (image: Image, fileName: str ): bool Export image.
GenImageColorfunc GenImageColor (width: int , height: int , color: Color): ImageGenerates image color.
GenImageGradientLinearfunc GenImageGradientLinear (width: int , height: int , direction: int , startColor: Color, endColor: Color): ImageGenerates image gradient linear.
GenImageGradientRadialfunc GenImageGradientRadial (width: int , height: int , density: f32, inner: Color, outer: Color): ImageGenerates image gradient radial.
GenImageGradientSquarefunc GenImageGradientSquare (width: int , height: int , density: f32, inner: Color, outer: Color): ImageGenerates image gradient square.
GenImageCheckedfunc GenImageChecked (width: int , height: int , checksX: int , checksY: int , col1: Color, col2: Color): ImageGenerates image checked.
GenImageWhiteNoisefunc GenImageWhiteNoise (width: int , height: int , factor: f32): ImageGenerates image white noise.
GenImagePerlinNoisefunc GenImagePerlinNoise (width: int , height: int , offsetX: int , offsetY: int , scale: f32): ImageGenerates image perlin noise.
GenImageCellularfunc GenImageCellular (width: int , height: int , tileSize: int ): ImageGenerates image cellular.
ImageCopyfunc ImageCopy (image: Image): ImageImage copy.
ImageFromImagefunc ImageFromImage (image: Image, rec: Rectangle): ImageImage from image.
ImageTextfunc ImageText (text: str , fontSize: int , color: Color): ImageImage text.
func ImageFormat (image &: Image, newFormat: int )Image format.
ImageToPOTfunc ImageToPOT (image &: Image, fill: Color)Image to power of two.
ImageCropfunc ImageCrop (image &: Image, crop: Rectangle)Image crop.
ImageAlphaCropfunc ImageAlphaCrop (image &: Image, threshold: f32)Image alpha crop.
ImageAlphaClearfunc ImageAlphaClear (image &: Image, color: Color, threshold: f32)Image alpha clear.
ImageAlphaMaskfunc ImageAlphaMask (image &: Image, alphaMask: Image)Image alpha mask.
ImageAlphaPremultiplyfunc ImageAlphaPremultiply (image &: Image)Image alpha premultiply.
ImageBlurGaussianfunc ImageBlurGaussian (image &: Image, blurSize: int )Image blur gaussian.
ImageResizefunc ImageResize (image &: Image, newWidth: int , newHeight: int )Image resize.
ImageResizeNNfunc ImageResizeNN (image &: Image, newWidth: int , newHeight: int )Image resize nearest neighbour.
ImageResizeCanvasfunc ImageResizeCanvas (image &: Image, newWidth: int , newHeight: int , offsetX: int , offsetY: int , fill: Color)Image resize canvas.
ImageMipmapsfunc ImageMipmaps (image &: Image)Image mipmaps.
ImageDitherfunc ImageDither (image &: Image, rBpp: int , gBpp: int , bBpp: int , aBpp: int )Image dither.
ImageFlipVerticalfunc ImageFlipVertical (image &: Image)Image flip vertical.
ImageFlipHorizontalfunc ImageFlipHorizontal (image &: Image)Image flip horizontal.
ImageRotatefunc ImageRotate (image &: Image, degrees: int )Image rotate.
ImageRotateCWfunc ImageRotateCW (image &: Image)Image rotate clockwise.
ImageRotateCCWfunc ImageRotateCCW (image &: Image)Image rotate counter-clockwise.
ImageColorTintfunc ImageColorTint (image &: Image, color: Color)Image color tint.
ImageColorInvertfunc ImageColorInvert (image &: Image)Image color invert.
ImageColorGrayscalefunc ImageColorGrayscale (image &: Image)Image color grayscale.
ImageColorContrastfunc ImageColorContrast (image &: Image, contrast: f32)Image color contrast.
ImageColorBrightnessfunc ImageColorBrightness (image &: Image, brightness: int )Image color brightness.
ImageColorReplacefunc ImageColorReplace (image &: Image, color: Color, replace: Color)Image color replace.
LoadImageColorsfunc LoadImageColors (image: Image): Color*Loads image colors and returns it.
UnloadImageColorsfunc UnloadImageColors (colors: Color*)Frees a loaded image colors.
GetImageAlphaBorderfunc GetImageAlphaBorder (image: Image, threshold: f32): RectangleReturns image alpha border.
GetImageColorfunc GetImageColor (image: Image, x: int , y: int ): ColorReturns image color.
ImageClearBackgroundfunc ImageClearBackground (dst &: Image, color: Color)Image clear background.
ImageDrawPixelfunc ImageDrawPixel (dst &: Image, posX: int , posY: int , color: Color)Image draw pixel.
ImageDrawPixelVfunc ImageDrawPixelV (dst &: Image, position: Vector2, color: Color)Image draw pixel.
ImageDrawLinefunc ImageDrawLine (dst &: Image, startPosX: int , startPosY: int , endPosX: int , endPosY: int , color: Color)Image draw line.
ImageDrawLineVfunc ImageDrawLineV (dst &: Image, startPos: Vector2, endPos: Vector2, color: Color)Image draw line.
ImageDrawCirclefunc ImageDrawCircle (dst &: Image, centerX: int , centerY: int , radius: int , color: Color)Image draw circle.
ImageDrawCircleVfunc ImageDrawCircleV (dst &: Image, center: Vector2, radius: int , color: Color)Image draw circle.
ImageDrawRectanglefunc ImageDrawRectangle (dst &: Image, posX: int , posY: int , width: int , height: int , color: Color)Image draw rectangle.
ImageDrawRectangleVfunc ImageDrawRectangleV (dst &: Image, position: Vector2, size: Vector2, color: Color)Image draw rectangle.
ImageDrawRectangleRecfunc ImageDrawRectangleRec (dst &: Image, rec: Rectangle, color: Color)Image draw rectangle rectangle.
ImageDrawRectangleLinesfunc ImageDrawRectangleLines (dst &: Image, rec: Rectangle, thick: int , color: Color)Image draw rectangle lines.
ImageDrawfunc ImageDraw (dst &: Image, src: Image, srcRec: Rectangle, dstRec: Rectangle, tint: Color)Image draw.
ImageDrawTextfunc ImageDrawText (dst &: Image, text: str , posX: int , posY: int , fontSize: int , color: Color)Image draw text.
LoadTexturefunc LoadTexture (fileName: str ): TextureLoads texture and returns it.
gui-raylib-LoadTexture.salam Copy
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
LoadTextureFromImagefunc LoadTextureFromImage (image: Image): TextureLoads texture from image and returns it.
LoadTextureCubemapfunc LoadTextureCubemap (image: Image, cubeLayout: int ): TextureLoads texture cubemap and returns it.
LoadRenderTexturefunc LoadRenderTexture (width: int , height: int ): RenderTextureLoads render texture and returns it.
IsTextureValidfunc IsTextureValid (texture: Texture): bool Returns true when the texture loaded correctly.
UnloadTexturefunc UnloadTexture (texture: Texture)Frees a loaded texture.
IsRenderTextureValidfunc IsRenderTextureValid (target: RenderTexture): bool Returns true when the render texture loaded correctly.
UnloadRenderTexturefunc UnloadRenderTexture (target: RenderTexture)Frees a loaded render texture.
UpdateTexturefunc UpdateTexture (texture: Texture, pixels: void*)Updates texture.
UpdateTextureRecfunc UpdateTextureRec (texture: Texture, rec: Rectangle, pixels: void*)Updates texture rectangle.
GenTextureMipmapsfunc GenTextureMipmaps (texture &: Texture)Generates texture mipmaps.
SetTextureFilterfunc SetTextureFilter (texture: Texture, filter: int )Sets texture filter.
SetTextureWrapfunc SetTextureWrap (texture: Texture, wrap: int )Sets texture wrap.
DrawTexturefunc DrawTexture (texture: Texture, posX: int , posY: int , tint: Color)Draws texture.
DrawTextureVfunc DrawTextureV (texture: Texture, position: Vector2, tint: Color)Draws texture.
DrawTextureExfunc DrawTextureEx (texture: Texture, position: Vector2, rotation: f32, scale: f32, tint: Color)Draws texture.
DrawTextureRecfunc DrawTextureRec (texture: Texture, source: Rectangle, position: Vector2, tint: Color)Draws texture rectangle.
DrawTextureProfunc DrawTexturePro (texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color)Draws texture.
DrawTextureNPatchfunc DrawTextureNPatch (texture: Texture, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color)Draws texture NP atch.
ColorIsEqualfunc ColorIsEqual (col1: Color, col2: Color): bool Color is equal.
Fadefunc Fade (color: Color, alpha: f32): ColorFade.
ColorToIntfunc ColorToInt (color: Color): int Color to int.
ColorNormalizefunc ColorNormalize (color: Color): Vector4Color normalize.
ColorFromNormalizedfunc ColorFromNormalized (normalized: Vector4): ColorColor from normalized.
ColorToHSVfunc ColorToHSV (color: Color): Vector3Color to HSV.
ColorFromHSVfunc ColorFromHSV (hue: f32, saturation: f32, value: f32): ColorColor from HSV.
ColorTintfunc ColorTint (color: Color, tint: Color): ColorColor tint.
ColorBrightnessfunc ColorBrightness (color: Color, factor: f32): ColorColor brightness.
ColorContrastfunc ColorContrast (color: Color, contrast: f32): ColorColor contrast.
ColorAlphafunc ColorAlpha (color: Color, alpha: f32): ColorColor alpha.
ColorAlphaBlendfunc ColorAlphaBlend (dst: Color, src: Color, tint: Color): ColorColor alpha blend.
ColorLerpfunc ColorLerp (color1: Color, color2: Color, factor: f32): ColorColor lerp.
GetColorfunc GetColor (hexValue: u32): ColorReturns color.
GetPixelColorfunc GetPixelColor (srcPtr: void*, format: int ): ColorReturns pixel color.
SetPixelColorfunc SetPixelColor (dstPtr: void*, color: Color, format: int )Sets pixel color.
GetPixelDataSizefunc GetPixelDataSize (width: int , height: int , format: int ): int Returns pixel data size.
GenImageGradientRadialfunc GenImageGradientRadial (width: int , height: int , density: f64 , inner: Color, outer: Color): ImageGenerates image gradient radial.
GenImageGradientSquarefunc GenImageGradientSquare (width: int , height: int , density: f64 , inner: Color, outer: Color): ImageGenerates image gradient square.
GenImageWhiteNoisefunc GenImageWhiteNoise (width: int , height: int , factor: f64 ): ImageGenerates image white noise.
GenImagePerlinNoisefunc GenImagePerlinNoise (width: int , height: int , offsetX: int , offsetY: int , scale: f64 ): ImageGenerates image perlin noise.
ImageAlphaCropfunc ImageAlphaCrop (image &: Image, threshold: f64 )Image alpha crop.
ImageAlphaClearfunc ImageAlphaClear (image &: Image, color: Color, threshold: f64 )Image alpha clear.
ImageColorContrastfunc ImageColorContrast (image &: Image, contrast: f64 )Image color contrast.
GetImageAlphaBorderfunc GetImageAlphaBorder (image: Image, threshold: f64 ): RectangleReturns image alpha border.
DrawTextureExfunc DrawTextureEx (texture: Texture, position: Vector2, rotation: f64 , scale: f64 , tint: Color)Draws texture.
DrawTextureProfunc DrawTexturePro (texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f64 , tint: Color)Draws texture.
DrawTextureNPatchfunc DrawTextureNPatch (texture: Texture, nPatchInfo: NPatchInfo, dest: Rectangle, origin: Vector2, rotation: f64 , tint: Color)Draws texture NP atch.
Fadefunc Fade (color: Color, alpha: f64 ): ColorFade.
ColorFromHSVfunc ColorFromHSV (hue: f64 , saturation: f64 , value: f64 ): ColorColor from HSV.
ColorBrightnessfunc ColorBrightness (color: Color, factor: f64 ): ColorColor brightness.
ColorContrastfunc ColorContrast (color: Color, contrast: f64 ): ColorColor contrast.
ColorAlphafunc ColorAlpha (color: Color, alpha: f64 ): ColorColor alpha.
ColorLerpfunc ColorLerp (color1: Color, color2: Color, factor: f64 ): ColorColor lerp.
SetShapesTexturefunc SetShapesTexture (texture: Texture, source: Rectangle)Sets shapes texture.
GetShapesTexturefunc GetShapesTexture (): TextureReturns shapes texture.
GetShapesTextureRectanglefunc GetShapesTextureRectangle (): RectangleReturns shapes texture rectangle.
DrawPixelfunc DrawPixel (posX: int , posY: int , color: Color)Draws pixel.
DrawPixelVfunc DrawPixelV (position: Vector2, color: Color)Draws pixel.
DrawLinefunc DrawLine (startPosX: int , startPosY: int , endPosX: int , endPosY: int , color: Color)Draws line.
DrawLineVfunc DrawLineV (startPos: Vector2, endPos: Vector2, color: Color)Draws line.
DrawLineExfunc DrawLineEx (startPos: Vector2, endPos: Vector2, thick: f32, color: Color)Draws line.
DrawLineStripfunc DrawLineStrip (points: Vector2*, pointCount: int , color: Color)Draws line strip.
DrawLineBezierfunc DrawLineBezier (startPos: Vector2, endPos: Vector2, thick: f32, color: Color)Draws line bezier.
DrawCirclefunc DrawCircle (centerX: int , centerY: int , radius: f32, color: Color)Draws circle.
gui-raylib-DrawCircle.salam Copy
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
DrawCircleSectorfunc DrawCircleSector (center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: int , color: Color)Draws circle sector.
DrawCircleSectorLinesfunc DrawCircleSectorLines (center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: int , color: Color)Draws circle sector lines.
DrawCircleGradientfunc DrawCircleGradient (centerX: int , centerY: int , radius: f32, inner: Color, outer: Color)Draws circle gradient.
DrawCircleVfunc DrawCircleV (center: Vector2, radius: f32, color: Color)Draws circle.
DrawCircleLinesfunc DrawCircleLines (centerX: int , centerY: int , radius: f32, color: Color)Draws circle lines.
DrawCircleLinesVfunc DrawCircleLinesV (center: Vector2, radius: f32, color: Color)Draws circle lines.
DrawEllipsefunc DrawEllipse (centerX: int , centerY: int , radiusH: f32, radiusV: f32, color: Color)Draws ellipse.
DrawEllipseLinesfunc DrawEllipseLines (centerX: int , centerY: int , radiusH: f32, radiusV: f32, color: Color)Draws ellipse lines.
DrawRingfunc DrawRing (center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: int , color: Color)Draws ring.
DrawRingLinesfunc DrawRingLines (center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: int , color: Color)Draws ring lines.
DrawRectanglefunc DrawRectangle (posX: int , posY: int , width: int , height: int , color: Color)Draws rectangle.
DrawRectangleVfunc DrawRectangleV (position: Vector2, size: Vector2, color: Color)Draws rectangle.
DrawRectangleRecfunc DrawRectangleRec (rec: Rectangle, color: Color)Draws rectangle rectangle.
DrawRectangleProfunc DrawRectanglePro (rec: Rectangle, origin: Vector2, rotation: f32, color: Color)Draws rectangle.
DrawRectangleGradientVfunc DrawRectangleGradientV (posX: int , posY: int , width: int , height: int , top: Color, bottom: Color)Draws rectangle gradient.
DrawRectangleGradientHfunc DrawRectangleGradientH (posX: int , posY: int , width: int , height: int , left: Color, right: Color)Draws rectangle gradient h.
DrawRectangleGradientExfunc DrawRectangleGradientEx (rec: Rectangle, topLeft: Color, bottomLeft: Color, topRight: Color, bottomRight: Color)Draws rectangle gradient.
DrawRectangleLinesfunc DrawRectangleLines (posX: int , posY: int , width: int , height: int , color: Color)Draws rectangle lines.
DrawRectangleLinesExfunc DrawRectangleLinesEx (rec: Rectangle, lineThick: f32, color: Color)Draws rectangle lines.
DrawRectangleRoundedfunc DrawRectangleRounded (rec: Rectangle, roundness: f32, segments: int , color: Color)Draws rectangle rounded.
DrawTrianglefunc DrawTriangle (v1: Vector2, v2: Vector2, v3: Vector2, color: Color)Draws triangle.
DrawTriangleLinesfunc DrawTriangleLines (v1: Vector2, v2: Vector2, v3: Vector2, color: Color)Draws triangle lines.
DrawTriangleFanfunc DrawTriangleFan (points: Vector2*, pointCount: int , color: Color)Draws triangle fan.
DrawTriangleStripfunc DrawTriangleStrip (points: Vector2*, pointCount: int , color: Color)Draws triangle strip.
DrawPolyfunc DrawPoly (center: Vector2, sides: int , radius: f32, rotation: f32, color: Color)Draws poly.
DrawPolyLinesfunc DrawPolyLines (center: Vector2, sides: int , radius: f32, rotation: f32, color: Color)Draws poly lines.
DrawPolyLinesExfunc DrawPolyLinesEx (center: Vector2, sides: int , radius: f32, rotation: f32, lineThick: f32, color: Color)Draws poly lines.
DrawSplineLinearfunc DrawSplineLinear (points: Vector2*, pointCount: int , thick: f32, color: Color)Draws spline linear.
DrawSplineBasisfunc DrawSplineBasis (points: Vector2*, pointCount: int , thick: f32, color: Color)Draws spline basis.
DrawSplineCatmullRomfunc DrawSplineCatmullRom (points: Vector2*, pointCount: int , thick: f32, color: Color)Draws spline catmull rom.
DrawSplineBezierQuadraticfunc DrawSplineBezierQuadratic (points: Vector2*, pointCount: int , thick: f32, color: Color)Draws spline bezier quadratic.
DrawSplineBezierCubicfunc DrawSplineBezierCubic (points: Vector2*, pointCount: int , thick: f32, color: Color)Draws spline bezier cubic.
CheckCollisionRecsfunc CheckCollisionRecs (rec1: Rectangle, rec2: Rectangle): bool Returns true when the shapes (recs) collide.
gui-raylib-CheckCollisionRecs.salam Copy
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
CheckCollisionCirclesfunc CheckCollisionCircles (center1: Vector2, radius1: f32, center2: Vector2, radius2: f32): bool Returns true when the shapes (circles) collide.
CheckCollisionCircleRecfunc CheckCollisionCircleRec (center: Vector2, radius: f32, rec: Rectangle): bool Returns true when the shapes (circle rectangle) collide.
CheckCollisionPointRecfunc CheckCollisionPointRec (point: Vector2, rec: Rectangle): bool Returns true when the shapes (point rectangle) collide.
CheckCollisionPointCirclefunc CheckCollisionPointCircle (point: Vector2, center: Vector2, radius: f32): bool Returns true when the shapes (point circle) collide.
CheckCollisionPointTrianglefunc CheckCollisionPointTriangle (point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): bool Returns true when the shapes (point triangle) collide.
CheckCollisionPointLinefunc CheckCollisionPointLine (point: Vector2, p1: Vector2, p2: Vector2, threshold: int ): bool Returns true when the shapes (point line) collide.
CheckCollisionPointPolyfunc CheckCollisionPointPoly (point: Vector2, points: Vector2*, pointCount: int ): bool Returns true when the shapes (point poly) collide.
CheckCollisionLinesfunc CheckCollisionLines (startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint &: Vector2): bool Returns true when the shapes (lines) collide.
GetCollisionRecfunc GetCollisionRec (rec1: Rectangle, rec2: Rectangle): RectangleReturns collision rectangle.
DrawLineExfunc DrawLineEx (startPos: Vector2, endPos: Vector2, thick: f64 , color: Color)Draws line.
DrawLineBezierfunc DrawLineBezier (startPos: Vector2, endPos: Vector2, thick: f64 , color: Color)Draws line bezier.
DrawCirclefunc 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
DrawCircleSectorfunc DrawCircleSector (center: Vector2, radius: f64 , startAngle: f64 , endAngle: f64 , segments: int , color: Color)Draws circle sector.
DrawCircleSectorLinesfunc DrawCircleSectorLines (center: Vector2, radius: f64 , startAngle: f64 , endAngle: f64 , segments: int , color: Color)Draws circle sector lines.
DrawCircleGradientfunc DrawCircleGradient (centerX: int , centerY: int , radius: f64 , inner: Color, outer: Color)Draws circle gradient.
DrawCircleVfunc DrawCircleV (center: Vector2, radius: f64 , color: Color)Draws circle.
DrawCircleLinesfunc DrawCircleLines (centerX: int , centerY: int , radius: f64 , color: Color)Draws circle lines.
DrawCircleLinesVfunc DrawCircleLinesV (center: Vector2, radius: f64 , color: Color)Draws circle lines.
DrawEllipsefunc DrawEllipse (centerX: int , centerY: int , radiusH: f64 , radiusV: f64 , color: Color)Draws ellipse.
DrawEllipseLinesfunc DrawEllipseLines (centerX: int , centerY: int , radiusH: f64 , radiusV: f64 , color: Color)Draws ellipse lines.
DrawRingfunc DrawRing (center: Vector2, innerRadius: f64 , outerRadius: f64 , startAngle: f64 , endAngle: f64 , segments: int , color: Color)Draws ring.
DrawRingLinesfunc DrawRingLines (center: Vector2, innerRadius: f64 , outerRadius: f64 , startAngle: f64 , endAngle: f64 , segments: int , color: Color)Draws ring lines.
DrawRectangleProfunc DrawRectanglePro (rec: Rectangle, origin: Vector2, rotation: f64 , color: Color)Draws rectangle.
DrawRectangleLinesExfunc DrawRectangleLinesEx (rec: Rectangle, lineThick: f64 , color: Color)Draws rectangle lines.
DrawRectangleRoundedfunc DrawRectangleRounded (rec: Rectangle, roundness: f64 , segments: int , color: Color)Draws rectangle rounded.
DrawPolyfunc DrawPoly (center: Vector2, sides: int , radius: f64 , rotation: f64 , color: Color)Draws poly.
DrawPolyLinesfunc DrawPolyLines (center: Vector2, sides: int , radius: f64 , rotation: f64 , color: Color)Draws poly lines.
DrawPolyLinesExfunc DrawPolyLinesEx (center: Vector2, sides: int , radius: f64 , rotation: f64 , lineThick: f64 , color: Color)Draws poly lines.
DrawSplineLinearfunc DrawSplineLinear (points: Vector2*, pointCount: int , thick: f64 , color: Color)Draws spline linear.
DrawSplineBasisfunc DrawSplineBasis (points: Vector2*, pointCount: int , thick: f64 , color: Color)Draws spline basis.
DrawSplineCatmullRomfunc DrawSplineCatmullRom (points: Vector2*, pointCount: int , thick: f64 , color: Color)Draws spline catmull rom.
DrawSplineBezierQuadraticfunc DrawSplineBezierQuadratic (points: Vector2*, pointCount: int , thick: f64 , color: Color)Draws spline bezier quadratic.
DrawSplineBezierCubicfunc DrawSplineBezierCubic (points: Vector2*, pointCount: int , thick: f64 , color: Color)Draws spline bezier cubic.
CheckCollisionCirclesfunc CheckCollisionCircles (center1: Vector2, radius1: f64 , center2: Vector2, radius2: f64 ): bool Returns true when the shapes (circles) collide.
CheckCollisionCircleRecfunc CheckCollisionCircleRec (center: Vector2, radius: f64 , rec: Rectangle): bool Returns true when the shapes (circle rectangle) collide.
CheckCollisionPointCirclefunc CheckCollisionPointCircle (point: Vector2, center: Vector2, radius: f64 ): bool Returns true when the shapes (point circle) collide.