Skip to content

RSDKv5 Functions

Note

All functions' names and parameter lists are mainly written for the C API, but their usage differs in the C++ API. Refer to the Syntax and Example(s) sections of each page for how to use the functions in each language's API.

Audio

Function Description
GetSfx Retrieves the ID of the given sound effect.
PlaySfx Plays the sound effect in the given slot, looping it if a loop point is set.
StopSfx Stops all instances of the given sound effect playing.
PlayStream Plays the given music file, looping it if set to do so.
SetChannelAttributes Sets the volume, panning, and speed of the given channel to the given values.
StopChannel Stops playing the currently playing audio in the given channel, if any is playing.
PauseChannel Pauses the currently playing audio in the given channel, if any is playing.
ResumeChannel If the given channel's audio has been paused with PauseChannel(), resumes playing the audio.
SfxPlaying Checks if the given sound effect is playing in any channels.
ChannelActive Checks if a channel is currently playing audio or is paused.
GetChannelPos Gets the position of the current track in the given channel.
StopAllSfx Stops all instances of all sound effects playing. RSDKv5U only.

SpriteSheets

Function Description
LoadSpriteSheet Loads a spritesheet and returns the ID of it.

Graphics

Function Description
LoadSpriteAnimation Loads a SpriteAnimation and returns the ID of it.
CreateSpriteAnimation Creates a SpriteAnimation based on the given parameters and returns the ID of it.
SetSpriteAnimation Applies a set of frames to an animator.
EditSpriteAnimation Replaces the properties of an animation with the given parameters.
SetSpriteString Converts a string into a sprite string.
FindSpriteAnimation Attempts to find an animation entry by name.
GetFrame Retrieves a specific SpriteFrame from a SpriteAnimation.
GetHitbox Gets a Hitbox from the animator's current frame.
GetFrameID Gets the unicode char value of the animator's current frame.
GetStringWidth Retrieves the width of a string in pixels when displayed with DrawText().
ProcessAnimation Processes the animation applied to an animator.

Debugging

Function Description
ClearViewableVariables Clears all loaded viewable variables.
AddViewableVariable Adds a viewable variable to the Dev Menu.

Printing

Function Description
PrintLog Prints a message to the console.
PrintText Prints a const char string to the console.
PrintString Prints a String variable to the console.
PrintUInt32 Prints an unsigned integer to the console.
PrintInt32 Prints a signed integer to the console.
PrintFloat Prints a float value to the console.
PrintVector2 Prints a Vector2 variable to the console.
PrintHitbox Prints a Hitbox variable to the console.

Objects & Entities

Function Description
FindObject Finds a loaded object by name and retrieves its ID.

Scene Management

Function Description
SetScene Sets the scene category and list position to the matching scene entry in the GameConfig.
SetEngineState Sets the state of the engine.
ForceHardReset Sets whether the next stage reload should reload all assets.
CheckValidScene Checks if SceneInfo->activeCategory and SceneInfo->listPos point to a valid scene in the GameConfig.
CheckSceneFolder Reads the name of the current stage's folder.
LoadScene Loads a stage based on SceneInfo->activeCategory and SceneInfo->listPos.

Videos & Images

Function Description
LoadVideo Loads and plays a video.
LoadImage Loads and displays an image.

Miscellaneous

Function Description
NotifyCallback Sends the given callback to communicate to Hedgehog Engine 2. Sonic Origins only.
HasNotifyCallback Checks if the game has access to NotifyCallback(). Sonic Origins only.
SetGameFinished Notifies the engine that the game has been finished. Sonic Origins only.

Editor

Function Description
RSDK_ACTIVE_VAR Sets a variable to be the "active variable" when using RSDK_ENUM_VAR().
RSDK_ENUM_VAR Adds an enum variable to the current active variable.
showGizmos Checks if gizmos should be visible for this object.
RSDK_DRAWING_OVERLAY Enables/disables "overlay" mode when drawing.