Command reference
Every command, one search away
689 commands for 2D, 3D, sound, input, networking and more - each with its parameters, many with an example you can open and run.
2D · Program Flow 28
IfRuns code only when a condition is trueThenEnds the condition of an IfElseCode to run when an If's condition is falseElseIfTests another condition inside an IfElse IfTests another condition inside an IfEndIfEnds an If blockEnd IfEnds an If blockSelectChooses between cases by valueCaseOne choice inside a SelectDefaultThe choice when no Case matchesEnd SelectEnds a Select blockForLoops a counter from one value to anotherToThe end value of a For loopStepHow much a For loop counts byNextEnds a For loopWhileLoops while a condition is trueWendEnds a While loopRepeatStarts a loop that runs until a conditionUntilEnds a Repeat loop when trueForeverEnds a Repeat loop that never stopsExitLeaves the loop it is inGotoJumps to a labelGosubJumps to a label and comes back on ReturnReturnReturns from a Gosub or a functionEndEnds the programFunctionDeclares your own commandEnd FunctionEnds a functionIncludeAdds another source file
2D · Types 14
EachLoops through every object of a typeNullNo objectTypeDeclares a custom typeFieldA value stored in a custom typeEnd TypeEnds a Type declarationNewCreates an object of a custom typeDeleteDeletes an object of a custom typeFirstThe first object of a typeLastThe last object of a typeAfterThe object after anotherBeforeThe object before anotherInsertMoves an object in its type's listHandleObject
2D · Variables 4
2D · Conversions 3
2D · Operators 11
2D · Data 3
2D · Basic 14
PrintPrints a line of textWritePrints text without starting a new lineInputReads a line of text typed by the userDebugLogWrites a message to the debug logRuntimeErrorStops the program with an error messageAppTitleSets the window titleCommandLineReturns the command line passed to the programStopHalts the program in the debuggerGetEnvReturns an environment variableSetEnvSets an environment variableSystemPropertyReturns a system propertyExecFileOpens a file or program with the systemCallDLLCalls a function in a native libraryDialectSelects a language dialect (ignored)
2D · Maths 19
AbsAbsolute valueSgnSign of a value: -1, 0 or 1SinSine of an angle in degreesCosCosine of an angle in degreesTanTangent of an angle in degreesASinArc sine, in degreesACosArc cosine, in degreesATanArc tangent, in degreesATan2Angle of the vector (x,y), in degreesSqrSquare rootFloorLargest whole number not greater than valueCeilSmallest whole number not less than valueExpe raised to a powerLogNatural logarithmLog10Base 10 logarithmRndRandom float between from and toRandRandom integer between from and to (inclusive)SeedRndSeeds the random number generatorRndSeedReturns the current random seed
2D · Strings 16
LenLength of a stringLeftLeftmost characters of a stringRightRightmost characters of a stringMidPart of a string (offset starts at 1)UpperConverts to upper caseLowerConverts to lower caseTrimRemoves leading and trailing spacesLSetPads or truncates to length, aligned leftRSetPads or truncates to length, aligned rightReplaceReplaces all occurrences of find$InstrPosition of find$ in string$ (0 if absent)ChrCharacter for a character codeAscCharacter code of the first characterHexHexadecimal representationBinBinary representationStringRepeats a string
2D · Time 7
MilliSecsMilliseconds since the system startedDelayPauses the programCurrentDateToday's date, e.g. "18 Nov 2026"CurrentTimeThe time, e.g. "14:05:09"CreateTimerCreates a timer ticking frequency times per secondWaitTimerWaits for the timer to tick; returns ticks since the last waitFreeTimerFrees a timer
2D · Banks 17
CreateBankCreates a memory bankFreeBankFrees a memory bankBankSizeSize of a bank in bytesResizeBankResizes a bankCopyBankCopies bytes between banksPeekByteReads an unsigned bytePeekShortReads an unsigned 16 bit valuePeekIntReads a signed 32 bit valuePeekLongReads a signed 64 bit valuePeekFloatReads a 32 bit floatPeekDoubleReads a 64 bit floatPokeByteWrites a bytePokeShortWrites a 16 bit valuePokeIntWrites a 32 bit valuePokeLongWrites a 64 bit valuePokeFloatWrites a 32 bit floatPokeDoubleWrites a 64 bit float
2D · Files 38
OpenFileOpens a file for reading and writingReadFileOpens a file for readingWriteFileCreates a file for writingCloseFileCloses a fileFilePosCurrent position in a fileSeekFileMoves to a position in a fileEofTrue when the end of the file has been reachedReadAvailBytes available to readReadByteReads a byteReadShortReads a 16 bit valueReadIntReads a 32 bit valueReadLongReads a 64 bit valueReadFloatReads a 32 bit floatReadDoubleReads a 64 bit floatReadStringReads a length-prefixed stringReadLineReads a line of textWriteByteWrites a byteWriteShortWrites a 16 bit valueWriteIntWrites a 32 bit valueWriteLongWrites a 64 bit valueWriteFloatWrites a 32 bit floatWriteDoubleWrites a 64 bit floatWriteStringWrites a length-prefixed stringWriteLineWrites a line of textReadBytesReads bytes into a bankWriteBytesWrites bytes from a bankCopyStreamCopies one stream into anotherFileType0 = missing, 1 = file, 2 = folderFileSizeSize of a file in bytesCurrentDirThe current folderChangeDirChanges the current folderCreateDirCreates a folderDeleteDirDeletes an empty folderDeleteFileDeletes a fileCopyFileCopies a fileReadDirOpens a folder for listingNextFileNext entry in a folder listing ("" when done)CloseDirCloses a folder listing
2D · Graphics 47
GraphicsOpens a 2D graphics displayEndGraphicsCloses the graphics displayGraphicsWidthWidth of the displayGraphicsHeightHeight of the displayGraphicsDepthColour depth of the displayGraphicsBufferThe current drawing bufferSetBufferSets the buffer used by drawing commandsBackBufferThe back bufferFrontBufferThe front bufferFlipShows the back bufferClsClears the current bufferClsColorSets the colour used by ClsColorSets the drawing colourColorRedRed component of the drawing colourColorGreenGreen component of the drawing colourColorBlueBlue component of the drawing colourGetColorSets the drawing colour to the pixel at x,yOriginSets the drawing originViewportRestricts drawing to a rectanglePlotDraws a pixelLineDraws a lineRectDraws a rectangleOvalDraws an ovalTextDraws textLocateSets the Print cursor positionVWaitWaits for the vertical blankScanLineCurrent scan lineTotalVidMemTotal video memoryAvailVidMemAvailable video memoryCountGfxModesNumber of display modesGfxModeWidthWidth of a display modeGfxModeHeightHeight of a display modeGfxModeDepthDepth of a display modeGraphicsLostTrue if the display was lostSetGammaSets a gamma ramp entryUpdateGammaApplies gamma changesLoadBufferLoads an image file into a bufferSaveBufferSaves a buffer as an image fileLockBufferLocks a buffer for fast pixel accessUnlockBufferUnlocks a bufferReadPixelReads a pixel as ARGBWritePixelWrites an ARGB pixelReadPixelFastReads a pixel from a locked bufferWritePixelFastWrites a pixel to a locked bufferCopyPixelCopies a pixelCopyPixelFastCopies a pixel between locked buffersCopyRectCopies a rectangle
2D · Fonts 7
2D · Images 32
LoadImageLoads an imageLoadAnimImageLoads an image strip as animation framesCreateImageCreates a blank imageCopyImageCopies an imageFreeImageFrees an imageSaveImageSaves an image to a fileGrabImageCopies part of the current buffer into an imageImageBufferThe buffer of an imageDrawImageDraws an image (masked)DrawBlockDraws an image (not masked)DrawImageRectDraws part of an imageDrawBlockRectDraws part of an image (not masked)TileImageTiles an image over the bufferTileBlockTiles an image over the buffer (not masked)MaskImageSets the transparent colour of an imageHandleImageSets the handle of an imageMidHandleSets the handle of an image to its centreAutoMidHandleAutomatically centre new image handlesImageWidthWidth of an imageImageHeightHeight of an imageImageXHandleX handle of an imageImageYHandleY handle of an imageScaleImageScales an imageResizeImageResizes an imageRotateImageRotates an imageTFormImageTransforms an image by a 2x2 matrixTFormFilterEnables filtering for image transformsImagesOverlapTrue if two image rectangles overlapImagesCollidePixel-perfect collision testRectsOverlapTrue if two rectangles overlapImageRectOverlapImage/rectangle overlap testImageRectCollidePixel-perfect image/rectangle test
2D · Keyboard 5
2D · Mouse 14
MouseDownTrue while a mouse button is heldMouseHitNumber of clicks since last checkedGetMouseNext mouse button clicked (0 if none)WaitMouseWaits for a mouse clickMouseXMouse X positionMouseYMouse Y positionMouseZMouse wheel positionMouseXSpeedMouse X movement since last checkedMouseYSpeedMouse Y movement since last checkedMouseZSpeedMouse wheel movement since last checkedMoveMouseMoves the mouse pointerFlushMouseClears the mouse stateHidePointerHides the mouse pointerShowPointerShows the mouse pointer
2D · Joystick 18
JoyTypeType of joystick connectedJoyDownTrue while a joystick button is heldJoyHitNumber of presses since last checkedGetJoyNext joystick button pressedWaitJoyWaits for a joystick buttonJoyXJoystick X axis (-1 to 1)JoyYJoystick Y axis (-1 to 1)JoyZJoystick Z axisJoyUJoystick U axisJoyVJoystick V axisJoyPitchJoystick pitchJoyYawJoystick yawJoyRollJoystick rollJoyHatJoystick hat direction in degrees (-1 if centred)JoyXDirJoystick X direction (-1, 0 or 1)JoyYDirJoystick Y direction (-1, 0 or 1)JoyZDirJoystick Z direction (-1, 0 or 1)FlushJoyClears the joystick state
2D · Sound 16
LoadSoundLoads a soundFreeSoundFrees a soundPlaySoundPlays a sound and returns its channelLoopSoundMakes a sound loop when playedSoundPitchSets the playback rate in HzSoundVolumeSets the volume (0 to 1)SoundPanSets the pan (-1 to 1)PlayMusicPlays a music file and returns its channelPlayCDTrackPlays a CD trackStopChannelStops a channelPauseChannelPauses a channelResumeChannelResumes a channelChannelPitchSets a channel's playback rate in HzChannelVolumeSets a channel's volumeChannelPanSets a channel's panChannelPlayingTrue if a channel is playing
2D · Graphics Drivers 6
2D · Movies 6
2D · TCP Networking 11
OpenTCPStreamConnects to a serverCloseTCPStreamCloses a TCP streamCreateTCPServerCreates a TCP serverCloseTCPServerCloses a TCP serverAcceptTCPStreamAccepts a new connection (0 if none)TCPStreamIPIP address of a TCP streamTCPStreamPortPort of a TCP streamTCPTimeoutsSets TCP timeoutsCountHostIPsNumber of IP addresses of a hostHostIPAn IP address found by CountHostIPsDottedIPConverts an IP address to a dotted string
2D · UDP Networking 9
CreateUDPStreamCreates a UDP streamCloseUDPStreamCloses a UDP streamSendUDPMsgSends the written data as a messageRecvUDPMsgReceives a message; returns the sender IP (0 if none)UDPStreamIPIP address of a UDP streamUDPStreamPortPort of a UDP streamUDPMsgIPSender IP of the last messageUDPMsgPortSender port of the last messageUDPTimeoutsSets the UDP receive timeout
2D · Multiplayer 14
StartNetGameStarts or joins a network gameHostNetGameHosts a network gameJoinNetGameJoins a network gameStopNetGameLeaves the network gameCreateNetPlayerCreates a local playerDeleteNetPlayerDeletes a local playerNetPlayerNameName of a playerNetPlayerLocalTrue if a player is localSendNetMsgSends a messageRecvNetMsgTrue if a message was receivedNetMsgTypeType of the received messageNetMsgFromSender of the received messageNetMsgToRecipient of the received messageNetMsgDataData of the received message
2D · Joystick Extra 2
3D · Graphics 6
3D · Sound 3
3D · 3D World 12
RenderWorldRenders the 3D worldUpdateWorldUpdates animation, collisions and physicsCaptureWorldCaptures the world state for tweeningClearWorldFrees 3D resourcesAmbientLightSets the ambient light colourWireFrameEnables wireframe renderingAntiAliasEnables anti-aliasingDitherEnables ditheringWBufferEnables w-bufferingHWMultiTexEnables hardware multitexturingTrisRenderedTriangles rendered in the last frameCountEntitiesNumber of entities in the world
3D · Camera 15
CreateCameraCreates a cameraCameraViewportSets the camera's area of the screenCameraClsColorSets the camera background colourCameraClsModeSets what the camera clearsCameraRangeSets the camera's near and far rangeCameraZoomSets the camera zoomCameraProjMode0 = off, 1 = perspective, 2 = orthographicCameraFogMode0 = no fog, 1 = linear fogCameraFogRangeSets the fog rangeCameraFogColorSets the fog colourCameraProjectProjects a 3D point to the screenProjectedXScreen X of the last CameraProjectProjectedYScreen Y of the last CameraProjectProjectedZDepth of the last CameraProjectEntityInViewTrue if an entity is visible from a camera
3D · Lights 4
3D · Meshes 26
CreatePivotCreates an invisible entityCreateCubeCreates a cubeCreateSphereCreates a sphereCreateCylinderCreates a cylinderCreateConeCreates a coneCreatePlaneCreates an infinite planeCreateMirrorCreates a mirror planeCreateMeshCreates an empty meshLoadMeshLoads a mesh (.glb, .gltf, .fbx, .obj)LoadAnimMeshLoads an animated mesh hierarchyCopyMeshCopies a meshAddMeshAdds one mesh to anotherFlipMeshFlips mesh facesPaintMeshPaints all surfaces of a meshFitMeshFits a mesh into a boxScaleMeshScales mesh verticesRotateMeshRotates mesh verticesPositionMeshMoves mesh verticesUpdateNormalsRecalculates mesh normalsMeshWidthWidth of a meshMeshHeightHeight of a meshMeshDepthDepth of a meshMeshesIntersectTrue if two meshes intersectCountSurfacesNumber of surfaces in a meshGetSurfaceA surface of a mesh (index starts at 1)LightMeshApplies lighting to vertex colours
3D · Surfaces 28
CreateSurfaceCreates a surfaceAddVertexAdds a vertexAddTriangleAdds a triangleVertexCoordsSets a vertex positionVertexNormalSets a vertex normalVertexColorSets a vertex colourVertexTexCoordsSets vertex texture coordinatesCountVerticesNumber of verticesCountTrianglesNumber of trianglesVertexXVertex XVertexYVertex YVertexZVertex ZVertexNXVertex normal XVertexNYVertex normal YVertexNZVertex normal ZVertexRedVertex redVertexGreenVertex greenVertexBlueVertex blueVertexAlphaVertex alphaVertexUVertex UVertexVVertex VVertexWVertex WTriangleVertexVertex index of a triangle cornerClearSurfaceClears a surfacePaintSurfacePaints a surfaceFindSurfaceFinds a surface painted with a brushGetSurfaceBrushBrush of a surfaceGetEntityBrushBrush of an entity
3D · Brushes 9
3D · Textures 17
CreateTextureCreates a textureLoadTextureLoads a textureLoadAnimTextureLoads an animated textureFreeTextureFrees a textureTextureBlendSets a texture blend modeTextureCoordsSets which UV set a texture usesScaleTextureScales a texturePositionTexturePositions a textureRotateTextureRotates a textureTextureWidthWidth of a textureTextureHeightHeight of a textureTextureBufferThe buffer of a textureTextureNameFile name of a textureTextureFilterApplies flags to textures loaded with matching namesClearTextureFiltersRemoves all texture filtersSetCubeFaceSelects the cube map face to draw toSetCubeModeSets the cube map mode
3D · Entity Control 16
PositionEntityPositions an entityMoveEntityMoves an entity relative to its orientationTranslateEntityMoves an entity along the world axesRotateEntitySets an entity's rotationTurnEntityTurns an entityPointEntityPoints an entity at anotherAlignToVectorAligns an entity axis to a vectorScaleEntityScales an entityEntityParentChanges an entity's parentFreeEntityFrees an entity and its childrenCopyEntityCopies an entityShowEntityShows an entityHideEntityHides an entityNameEntityNames an entityEntityNameName of an entityEntityClassClass of an entity ("Mesh", "Camera", ...)
3D · Entity State 25
EntityXEntity X positionEntityYEntity Y positionEntityZEntity Z positionEntityPitchEntity pitchEntityYawEntity yawEntityRollEntity rollEntityScaleXEntity X scaleEntityScaleYEntity Y scaleEntityScaleZEntity Z scaleGetMatElementElement of an entity's matrixGetParentParent of an entityCountChildrenNumber of childrenGetChildA child (index starts at 1)FindChildFinds a child by nameEntityDistanceDistance between two entitiesDeltaYawYaw needed to face another entityDeltaPitchPitch needed to face another entityTFormPointTransforms a point between spacesTFormVectorTransforms a vector between spacesTFormNormalTransforms a normal between spacesTFormedXX result of the last TForm commandTFormedYY result of the last TForm commandTFormedZZ result of the last TForm commandVectorYawYaw of a vectorVectorPitchPitch of a vector
3D · Entity Appearance 9
EntityColorSets an entity colourEntityAlphaSets an entity alphaEntityShininessSets an entity shininessEntityTextureApplies a textureEntityBlendSets an entity blend modeEntityFXSets entity effectsEntityAutoFadeFades an entity with distanceEntityOrderSets drawing orderPaintEntityPaints an entity with a brush
3D · Collisions 19
CollisionsEnables collisions between typesClearCollisionsClears all collision settingsEntityTypeSets an entity's collision typeGetEntityTypeCollision type of an entityEntityRadiusSets an entity's collision radiusEntityBoxSets an entity's collision boxResetEntityResets an entity's collision stateEntityCollidedEntity hit during the last UpdateWorldCountCollisionsNumber of collisions during the last UpdateWorldCollisionXCollision XCollisionYCollision YCollisionZCollision ZCollisionNXCollision normal XCollisionNYCollision normal YCollisionNZCollision normal ZCollisionTimeCollision timeCollisionEntityEntity collided withCollisionSurfaceSurface collided withCollisionTriangleTriangle collided with
3D · Picking 15
EntityPickModeSets how an entity is pickedCameraPickPicks the entity under a screen pointLinePickPicks along a lineEntityPickPicks along an entity's Z axisEntityVisibleTrue if one entity can see anotherPickedXX of the last pickPickedYY of the last pickPickedZZ of the last pickPickedNXNormal X of the last pickPickedNYNormal Y of the last pickPickedNZNormal Z of the last pickPickedTimeTime of the last pickPickedEntityEntity of the last pickPickedSurfaceSurface of the last pickPickedTriangleTriangle of the last pick
3D · Animation 10
AnimateAnimates an entitySetAnimTimeSets an entity's animation timeAnimSeqCurrent animation sequenceAnimLengthLength of the current sequenceAnimTimeCurrent animation timeAnimatingTrue if an entity is animatingExtractAnimSeqCreates a sequence from framesAddAnimSeqAdds an animation sequenceLoadAnimSeqLoads an animation sequence from a fileSetAnimKeySets an animation key
3D · Terrain 10
CreateTerrainCreates a terrainLoadTerrainLoads a terrain from a heightmapTerrainDetailSets terrain detailTerrainShadingEnables terrain shadingTerrainHeightHeight at a grid point (0 to 1)ModifyTerrainSets the height at a grid pointTerrainSizeGrid size of a terrainTerrainXTerrain X at a world positionTerrainYTerrain height at a world positionTerrainZTerrain Z at a world position
3D · Sprites 6
3D · Graphics Drivers 3
3D · Models 10
LoadMD2Loads an MD2 modelAnimateMD2Animates an MD2 modelMD2AnimatingTrue if an MD2 model is animatingMD2AnimLengthAnimation length of an MD2 modelMD2AnimTimeAnimation time of an MD2 modelLoadBSPLoads a BSP levelBSPAmbientLightSets a BSP level's ambient lightBSPLightingEnables BSP lightmapsLoaderMatrixSets the transform applied to loaded modelsGetBrushTextureTexture of a brush
3D · Shadows 3
3D · Animation Extra 4
3D · Effects 3
3D · Physics 48
PhysicsGravitySets the pull of gravity on dynamic bodiesPhysicsRateHow much time each UpdateWorld simulates, as steps a secondEntityPhysicsGives an entity a physics body: 0 none, 1 static, 2 dynamic, 3 kinematic, 4 triggerGetEntityPhysicsPhysics mode of an entityEntityShapeSets the shape of a physics body: 0 auto, 1 box, 2 sphere, 3 capsule, 4 cylinder, 5 hull, 6 meshAddEntityShapeAdds another shape to a physics bodyEntityPhysicsTypePuts a physics body in a type (1 to 32) for PhysicsCollide and triggersGetEntityPhysicsTypePhysics type of an entityPhysicsCollideSets whether two physics types collideEntityMassSets the mass of a physics bodyEntityFrictionSets how much a physics body grips what it touchesEntityBounceSets how bouncy a physics body is, 0 to 1EntityDampingSets how quickly a physics body slows downEntityGravitySets how strongly gravity pulls a physics body: 1 normal, 0 none, below 0 floats upEntityLockAxesStops a physics body moving along or turning about some axesEntityCCDStops a fast physics body passing through thin wallsEntityCanSleepSets whether a physics body may sleep when it comes to restEntitySleepingTrue if a physics body is resting asleepWakeEntityWakes a sleeping physics bodyApplyForcePushes a physics body during the next UpdateWorldApplyImpulseGives a physics body a sudden pushApplyTorqueTwists a physics body during the next UpdateWorldApplyTorqueImpulseGives a physics body a sudden twistSetEntityVelocitySets how fast a physics body moves, in units a secondEntityVelocityXX speed of a physics body, in units a secondEntityVelocityYY speed of a physics body, in units a secondEntityVelocityZZ speed of a physics body, in units a secondSetEntitySpinSets how fast a physics body turns, in degrees a secondEntitySpinPitchPitch turning speed of a physics body, in degrees a secondEntitySpinYawYaw turning speed of a physics body, in degrees a secondEntitySpinRollRoll turning speed of a physics body, in degrees a secondCountContactsNumber of contacts a physics body had during the last UpdateWorldContactEntityEntity touched by a physics contactContactXWorld X of a physics contactContactYWorld Y of a physics contactContactZWorld Z of a physics contactContactNXX of a physics contact's normalContactNYY of a physics contact's normalContactNZZ of a physics contact's normalContactImpulseHow hard a physics contact pushedTriggerCountNumber of physics bodies inside a triggerTriggerEntityA physics body inside a triggerEntityInTriggerTrue if a physics body is inside a triggerPhysicsLinePickFinds the first physics body along a linePhysicsOverlapNumber of physics bodies touching a spherePhysicsOverlapBoxNumber of physics bodies touching a boxOverlapEntityA physics body found by PhysicsOverlap or PhysicsOverlapBoxPhysicsDebugShows the shapes of physics bodies
3D · Physics Joints 12
PinJointJoins two physics bodies at a point they can swing aroundHingeJointJoins two physics bodies with a hinge, like a door or a wheelSliderJointJoins two physics bodies so one slides along an axisConeJointJoins two physics bodies like a shoulder: they swing within a coneFixedJointGlues two physics bodies togetherSpringJointJoins two physics bodies with a spring along an axisJointLimitsSets how far a joint can turn or slideJointMotorDrives a hinge or slider joint at a speedJointSpringMakes a slider or spring joint springyJointCollideSets whether joined bodies collide with each otherJointPositionHow far a joint has turned or slid since it was madeFreeJointRemoves a joint
3D · Physics Characters 5
EntityCharacterMakes an entity a character that walks, jumps and climbs stepsCharacterWalkSets how fast a character walks, in units a secondCharacterJumpMakes a character jump if it is on the groundCharacterOnFloorTrue if a character is standing on somethingCharacterPushSets how hard a character pushes physics bodies it walks into
3D · Physics Vehicles 6
AddWheelMakes an entity a wheel of a physics vehicleVehicleControlDrives a vehicle: throttle and steer from -1 to 1, brake from 0 to 1VehicleEngineSets a vehicle's engine force and how far its wheels steerVehicleSuspensionSets how a vehicle's springs and tyres behaveVehicleSpeedHow fast a vehicle is going forwards, in units a secondWheelContactThe entity a vehicle's wheel is resting on, or 0
