RSDKv4 Functions¶
3D¶
| Function | Description |
|---|---|
| Draw3DScene | Draws the active 3DScene data to the screen. |
| SetIdentityMatrix | Sets the matrix of matID to the identity state. |
| MatrixMultiply | Multiplies matrixA by matrixB. |
| MatrixTranslateXYZ | Translates matrix to translateX, translateY and translateZ. |
| MatrixScaleXYZ | Scales matrix to scaleX, scaleY and scaleZ. |
| MatrixRotate | Rotates matrix to angle on the specified axis. |
| MatrixRotateXYZ | Rotates matrix to angleX, angleY and angleZ. |
| MatrixInverse | Performs an inversion on matrix's values. |
| TransformVertices | Transform all vertices from startIndex to endIndex using matrix. |
Audio¶
| Function | Description |
|---|---|
| SetMusicTrack | Loads a music file in the given track slot with the given loop point. |
| PlayMusic | Plays the music currently loaded in the given track slot. |
| StopMusic | Stops playing the currently playing music track, if one is playing. |
| PauseMusic | Pauses the currently playing music track, if one is playing. |
| ResumeMusic | If a track has been paused with PauseMusic(), resumes playing the track. |
| SwapMusicTrack | Loads a music file in the given track slot with the given loop point, swapping the currently playing track if it's the one being overwritten. |
| PlaySfx | Plays the sound effect in the given slot in the GameConfig or StageConfig, looping it if set to do so. |
| StopSfx | Stops all instances of the given sound effect playing. |
| SetSfxAttributes | Sets the loop count and panning of the given sound effect to the given values. |
Drawing¶
| Function | Description |
|---|---|
| DrawTintRect | Draws a tinted rectangle to ixpos and iypos in screen-space. |
| LoadPalette | Loads a palette into palBank starting from startPalIndex, with an offset of startIndex and reading all colors through to endIndex. |
| RotatePalette | Rotates all colors in palBank from startIndex to endIndex, moving left or right depending on rotRight. |
| SetScreenFade | Adds a screen fade effect based on the r, g, b and alpha values. |
| SetActivePalette | Sets the active palette to palBank for all vertical screen lines from startLine to endLine. |
| SetPaletteFade | Blends palettes srcBankA and srcBankB, from indexes startIndex to endIndex, by blendAmount, and stores the new palette in dstBank. |
| GetPaletteEntry | Gets the palette entry in bank at index and stores it in store. |
| SetPaletteEntry | Sets the palette entry in bank at index to the value of color. |
| CopyPalette | Copies count colors from srcBank, starting from srcIndex, to destBank, starting at destIndex. |
| ClearScreen | Clears all pixels on screen with color clearIndex from the active palette. |
| DrawRect | Draws a rectangle to ixpos and iypos in screen-space, with a color based on the r, g, b, and alpha. |
| ClearDrawList | Removes all entries in drawList layer. |
| AddDrawListEntityRef | Adds objectPos to drawList layer. |
| GetDrawListEntityRef | Gets objectPos in drawList layer and stores it in store. |
| SetDrawListEntityRef | Sets objectPos in drawList layer to value. |
Graphics¶
| Function | Description |
|---|---|
| DrawNumbers | Draws a number in screen-space. |
| LoadSpriteSheet | Loads a spritesheet and assigns the ID to object.spritesheet. |
| RemoveSpriteSheet | Removes the given spritesheet from memory, if it is already loaded. |
| DrawSprite | Draws frame at the object's X and Y position. |
| DrawSpriteXY | Draws frame at a specified X and Y position. |
| DrawSpriteScreenXY | Draws frame at a specified X and Y position in screen-space. |
| SpriteFrame | Adds a SpriteFrame with the specified values. |
| EditFrame | Edits the pivots, width, height, and sheet coordinates of frame. |
| DrawSpriteFX | Draws frame at a specified X and Y position with visual effects. |
| DrawSpriteScreenFX | Draws frame at a specified X and Y position in screen-space with visual effects. |
| LoadAnimation | Loads an animation file for the current object type. |
| ProcessAnimation | Processes the current object's animation, based on the animation file loaded prior via LoadAnimation(). |
| DrawObjectAnimation | Draws an object's sprites from the animation file loaded prior via LoadAnimation(). |
| SetScreenCount | Sets the screen count. RSDKv5U only. |
| SetScreenVertices | Sets the screen vertices. RSDKv5U only. |
Math¶
| Function | Description |
|---|---|
| FlipSign | Flips the sign of the given variable; positive values will become negative values, and vice versa. |
| CheckEqual | Checks if x and y are equal and stores the result in checkResult. |
| CheckGreater | Checks if x is greater than y and stores the result in checkResult. |
| CheckLower | Checks if x is lower than y and stores the result in checkResult. |
| CheckNotEqual | Checks if x and y are not equal and stores the result in checkResult. |
| Rand | Gets a random value from 0 to max (not inclusive) and stores it in store. |
| Sin | Gets the value from the sin512 lookup table based on angle and sets it in store. |
| Cos | Gets the value from the cos512 lookup table based on angle and sets it in store. |
| Sin256 | Gets the value from the sin256 lookup table based on angle and sets it in store. |
| Cos256 | Gets the value from the cos256 lookup table based on angle and sets it in store. |
| ATan2 | Performs an arctan operation using x and y, storing the result in store. |
| Interpolate | Linearly interpolates x and y by percent and stores the result in store. |
| InterpolateXY | Linearly interpolates two points at once and stores the result in storeX and storeY respectively. |
| Not | Performs a NOT operation on value. |
| GetBit | Gets the binary bit at index bitPos from value and stores it in store. |
| SetBit | Sets index bitPos of value to bit and updates value accordingly. |
| GetTableValue | Gets the value at index from table and stores it in store. |
| SetTableValue | Sets the value at index from table to value. |
| Abs | Gets the absolute number of value. |
Object¶
| Function | Description |
|---|---|
| ResetObjectEntity | Resets an object in position slot with the type, propertyValue, xpos, and ypos specified. |
| BoxCollisionTest | Checks for collision of an object with another, using the hitbox values passed. |
| CreateTempObject | Creates a temporary object specified by type, propertyValue, xpos and ypos near the end of the object list. |
| ProcessObjectMovement | Handles tile collision of an object/player. |
| ProcessObjectControl | Handles object input variables. |
| ObjectTileCollision | Tries to collide with the foreground layer based on the position of object.ixpos + xOffset, object.iypos + yOffset. |
| ObjectTileGrip | Tries to collide with the foreground layer based on the position of object.ixpos + xOffset, object.iypos + yOffset. |
| SetObjectRange | Changes internal bounds, affecting all objects. |
| GetObjectValue | Gets object.valueXX of the object in slot corresponding to valueID and stores it in store. |
| SetObjectValue | Sets object.valueXX of the object in slot corresponding to valueID to value. |
| CopyObject | Copies count objects starting from srcSlot and pastes them to the object slots starting from destSlot. |
| GetAnimationByName | Gets the numeric ID of an animation in the current object's animation file. |
| CheckCameraProximity | Checks if the given position is within range of the camera(s). RSDKv5U only. |
Stages¶
| Function | Description |
|---|---|
| DrawActName | Draws the current stage's title. |
| LoadStage | Loads a stage based on stage.activeList and stage.listPos. |
| SetLayerDeformation | Sets the deformation data array of deformID, based on deformA and deformB. |
| GetTileLayerEntry | Gets the ID of the chunk at chunkX, chunkY on tile layer layer and stores it in store. |
| SetTileLayerEntry | Sets the chunk at chunkX, chunkY in tile layer layer to the index of value. |
| Get16x16TileInfo | Gets the value for infoType from the tile at tileX, tileY and stores it in store. |
| Set16x16TileInfo | Sets the value for infoType from the tile at tileX, tileY to value. |
| Copy16x16Tile | Copies the tileset image data of srcTile to dstTile. |
| CheckCurrentStageFolder | Reads the name of the current stage's folder. |
Miscellaneous¶
| Function | Description |
|---|---|
| CallNativeFunction | Sends a callback to the engine to run a native function. |
| CheckTouchRect | Checks if there's a touch input between the given coordinates. |
| CallFunction | Calls the given object function. |
| SetupMenu | Sets up menu with rowCount rows, selectionCount active selections and aligning set to alignment. |
| AddMenuEntry | Adds an entry to menu with the contents of text. |
| EditMenuEntry | Edits an entry of menu with the contents of text in rowID. |
| DrawMenu | Draws menu at xpos and ypos relative to the screen. |
| GetTextInfo | Gets the data of type from menu using index and stores it in store. |
| GetVersionNumber | Adds a text entry to menu with the engine's version as the text. |
| LoadTextFile | Loads menu based on the text file loaded from filePath. |
| Prints a message or integer to the console. | |
| ReadSaveRAM | Reads the contents of the save file on disk into SaveRAM. |
| WriteSaveRAM | Writes the contents of SaveRAM to the save file on disk. |
Input¶
| Function | Description |
|---|---|
| GetInputDeviceID | Stores the ID of an input device in store. RSDKv5U only. |
| GetFilteredInputDeviceID | Stores the filtered ID of an input device in store. RSDKv5U only. |
| GetInputDeviceType | Stores the type of an input device in store. RSDKv5U only. |
| IsInputDeviceAssigned | Checks if an input device has been assigned. RSDKv5U only. |
| AssignInputSlotToDevice | Assigns a player to an input device. RSDKv5U only. |
| IsInputSlotAssigned | Checks if a player has been assigned to an input device. RSDKv5U only. |
| ResetInputSlotAssignments | Resets all input slot assignments. RSDKv5U only. |
Deprecated¶
| Function | Description |
|---|---|
| LoadFontFile | Loads a bitmap font from filePath for use with text menus. |
| DrawText | Draws the contents of menu. |