Hello and welcome on the main documentation of the sxgd
plugin.
It’s also my first attempt at AsciiDoc.
The plugin contains extensions, modules, and nodes.
Note
|
Each class is prefixed by Sx for namespacing concerns.
|
Installing
The plugin needs to be available in the ./addons/sxgd
folder.
If you have Git, it is best installed as a Git submodule, using the following command in your Godot project directory:
git clone https://github.com/Srynetix/sxgd ./addons/sxgd
If not, you can directly unzip the plugin code in the ./addons/sxgd
folder.
Usage
You can use extensions by referring to their names, so the following code will work:
# A custom node of your project
extends Node
# Example: use the SxLog facility
var logger := SxLog.get_logger("MyNode")
func _ready() -> void:
# Example: generate a random color with a custom alpha value as a float
var my_color := SxColor.rand_with_alpha_f(0.5)
# Example: generate a random value
logger.info(SxRand.range_i(0, 10))
For most nodes and modules, you can directly drag’n’drop them, or inherit them, but there is one thing you can’t do: you can’t use them as autoloads. Well, you can, but not directly.
Contents
This section contains all of the components included in the plugins, with a short description. Click on the component name to access its specific documentation.
Extensions
Static methods and related utilities for any relevant part of Godot Engine.
-
SxArray: Array helpers (string trimming, …).
-
SxBuffer: Buffer helpers (zstd compression, …).
-
SxColor: Color helpers (applying an alpha value on an existing color, generating a random color, …).
-
SxContainer: Generic container (Array, Dictionary) helpers (equality checks, …).
-
SxInput: Input helpers (extract joystick movement from 4 joystick actions, …).
-
SxJson: JSON helpers (read file, write file, …).
-
SxLog: Log facility (get/create a logger, set a log level, …).
-
SxMath: Additional math functions (lerp a Vector3, align a transform with an axis, …).
-
SxNetwork: Network helpers (UUID generation, network shortcuts, …).
-
SxNode: Generic Node methods (print tree to string, …).
-
SxOs: Generic OS methods (check if OS is mobile, set window size from string, …).
-
SxRand: Additional rand methods (rand range with ints, random choice in array, …).
-
SxShader: Shader helpers (shortcuts to get/set a shader param, …).
-
SxText: Text helpers (case conversion, …).
-
SxTileMap: Tilemap helpers (get cell rotation, dump/restore, …).
-
SxUi: Control-related helpers (get default font, …).
Modules
Specific modules separated from the rest.
FontAwesome icons integration
-
SxFaButton: Ready-to-use
Button
with an integrated FontAwesome icon. -
SxFaFont: Font management wrapper around FontAwesome, useful for specific needs.
-
SxFaLabel: A label which display a FontAwesome icon.
Scene Runner
-
SxSceneRunner: Useful as a kind of "test suite" where you can select any scene from a specific folder, with on-screen navigation.
Virtual Controls
A customizable virtual control module (includes assets by Kenney, and ready-to-use samples):
-
SxVirtualButton: A simple customizable virtual button.
-
SxVirtualControls: The scene used to organize the controls on the screen.
-
SxVirtualJoystick: A simple customizable virtual joystick.
Nodes
Reusable nodes, organized in multiple categories.
Audio
Audio nodes.
-
SxAudioStreamPlayer: "Supercharged" audio player with multiple simultaneous voices.
Debug
Debug nodes.
-
SxDebugTools: Useful global debug UI, showing multiple panels:
-
Debug info: shows performance info at the top-left section of the screen
-
Log details: scrollable logs (only those printed with SxLog, not
print
) -
Node tracer: show currently enabled node tracers (see SxNodeTracer)
-
Scene tree dumps: show nodes currently in the scene tree, with support for the scene tree embedded in the SxListenServerPeer node.
-
In-game console: execute commands to interact with the game (see SxDebugConsole).
-
-
SxNodeTracer: Node parameter tracing system.
FX
Nodes concerning special effects / shaders / particles.
-
Screen effects: Full-screen effects you can use as nodes.
-
SxFxBetterBlur: A gaussian blur, compatible with GLES2.
-
SxFxChromaticAberration: A chromatic aberration effect.
-
SxFxDissolve: A dissolve effect.
-
SxFxGrayscale: A grayscale effect.
-
SxFxMotionBlur: A motion blur.
-
SxFxShockwave: An animated shockwave effect.
-
SxFxVignette: A vignette effect.
-
-
SxFxCamera: A special camera with FX and animation capabilities.
Networking
Networking-related and multiplayer-related nodes.
-
SxClientPeer: A generic client peer implementation.
-
SxClientRpc: Generic client RPC methods (synchronized scene spawning, …).
-
SxListenServerPeer: A ready-to-use listen server, to use a client/server combo on a same game instance.
-
SxRpcService: Wraps the client and server RPC methods, and the input synchronization.
-
SxServerPeer: A generic server peer implementation.
-
SxServerRpc: Generic server RPC methods (send input, update username, …).
-
SxSyncBarrier: Useful system to wait for all clients to do something.
-
SxSyncInput: Input synchronization system, using one
SxSyncPeerInput
per connected client. -
SxSyncPeerInput: Specific input status for a client (uses the input map, configurable with a
ProjectSettings
value)
UI
Control-related nodes.
-
SxFadingRichTextLabel: A wrapped
RichTextLabel
with a per-character fade-in effect.-
SxFadingRichTextEffect: The fade-in effect itself.
-
-
SxFullScreenConfirmationDialog: A big confirmation dialog, useful on small screens.
-
SxFullScreenDialog: A big dialog, useful on small screens.
-
SxFullScreenFileDialog: A big mobile-ready file selection dialog.
-
SxItemList: Simple
ItemList
wrapper with scrolling enabled on mobile.
Utils
Miscellaneous nodes.
-
SxCmdLineParser: Simple node which handles command-line arguments, needs to be overriden.
-
SxCVars: Console variables, pluggable in the SxDebugConsole.
-
SxGameData: A general-purpose in-memory (and on-disk) key-value store, to be used through inheritance and autoload.
-
SxLoadCache: A resource/scene loader, exposing a
load_resources
method to implement through inheritance and autoload. Useful to load every needed resources at game startup. -
SxSceneTransitioner: A simple scene transition node, with a fade-in/fade-out effect, to be used with inheritance as autoload.
Classes
SxArray
Inherits: Reference
Array helpers.
- Description
-
Generic array helpers.
Methods
|
SxAudioStreamPlayer
Inherits: Node
Audio player with multiple simultaneous voices.
- Description
-
An audio player with multiple simultaneous voices, configurable through the
max_voices
parameter.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Property Descriptions
-
int max_voices
Maximum simultaneous voices.
-
String audio_bus_output
Audio bus output.
-
Dictionary streams
Audio streams to play, indexed by name.
-
float initial_volume_db
Initial volume for each audio players.
Method Descriptions
-
void play_stream ( AudioStream stream )
Play an audio stream on an auto-selected voice.
-
void play_key ( String key )
Play a stored audio stream by key on an auto-selected voice.
-
AudioStreamPlayer get_voice ( int voice )
Get a specific AudioStreamPlayer.
SxBuffer
Inherits: Reference
Buffer helpers.
- Description
-
Generic buffer helpers.
Methods
|
|
|
Method Descriptions
-
static PackedByteArray zstd_compress ( PackedByteArray array )
Compress a byte array using zstd, adding original content size at the beginning.
The content size is needed for Godot to decompress, so the resulting byte array is not valid zstd compressed data. To have a valid zstd compressed data, you need to strip the first 64 bits.
-
static PackedByteArray zstd_decompress ( PackedByteArray array )
Decompress a byte array generated with
zstd_compress
.
It is not usable with zstd compressed data generated elsewhere, because it expects a 64 bit integer at first representing the original data size (needed for Godot).
SxCVars
Inherits: Node
Console vars.
- Description
-
Console vars, a dynamic key-value store bindable to the SxDebugConsole.
It’s a little special to use, so here’s a quick tutorial to implement custom CVars.
-
Create a new script (as an autoload), inheriting from SxCVars.
-
Create a class, extending from Object, with your list of variables as attributes.
extends SxCVars
# Declare your class containing your console vars.
class _Vars:
extends Object
var test_boolean := false
var test_string := "hello"
var test_integer := 1
var test_float := 2.5
func _init() -> void:
# This line will register the vars
_vars = _Vars.new()
# This line will bind the SxDebugConsole with the vars so you can use
# cvar_list / cvar_set / cvar_get commands
SxDebugConsole.bind_cvars(self)
SxClientPeer
Inherits: Node
Configurable network peer, client side.
- Description
-
Configurable network peer, client side.
Signals
-
connected_to_server ()
On successful connection to the target server.
-
connection_failed ()
On failed connection to the target server.
-
server_disconnected ()
On server disconnection.
-
players_updated ( Dictionary players )
On players data update (for example a username change).
Methods
|
SxClientRpc
Inherits: Node
Client RPC interface.
- Description
-
Client RPC interface.
Signals
-
spawned_from_server ( Node node )
When a node was spawn from the server request.
-
removed_from_server ( Node node )
When a node was removed from the server request.
-
players_updated ( Dictionary players )
On players data update (for example a username change).
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
-
void pong ( int peer_id )
Send a "pong" event to a specific peer.
-
void synchronize_node_broadcast ( NodePath path, Dictionary data )
Synchronize data from a specific node on all peers.
-
void remove_synchronized_node_broadcast ( NodePath path )
Remove a synchronized node on all peers.
-
void synchronize_players_broadcast ( Dictionary players )
Synchronize players data on all peers.
SxCmdLineParser
Inherits: Node
Simple command-line parser.
- Description
-
Simple command-line parser.
Inherit the node as an autoload and handle your custom command-line arguments by redeclaring the method
_handle_args
.
Methods
|
|
Method Descriptions
-
void _handle_args ( SxCmdLineParser.Args args )
Override this method to handle command-line arguments.
SxColor
Inherits: Reference
Color helpers.
- Description
-
Generic color helpers.
Methods
|
|
|
|
|
|
|
|
|
Method Descriptions
# Creates a semi-transparent "aqua" color
var c := SxColor.with_alpha_f(Color.aqua, 0.5)
# Creates a semi-transparent "aqua" color
var c := SxColor.with_alpha_i(Color.aqua, 127)
-
static Color rand ()
Generate a random color without transparency.
var c := SxColor.rand()
var c := SxColor.rand_with_alpha_f(0.5)
var c := SxColor.rand_with_alpha_f(0.5)
SxContainer
Inherits: Reference
Container helpers.
- Description
-
Generic container helpers.
Methods
|
|
|
|
|
Method Descriptions
var obj1 := {"one": 1, "two": [1, 2]}
var obj2 := {"one": 1, "two": [1, 2]}
var obj3 := {"one": 1, "two": [1, 2, 3]}
SxContainer.are_values_equal(obj1, obj2) # => true
SxContainer.are_values_equal(obj1, obj3) # => false
-
static bool are_dictionaries_equal ( Dictionary d1, Dictionary d2 )
Check deep-equality between two dictionaries.
var obj1 := {"one": 1, "two": [1, 2]}
var obj2 := {"one": 1, "two": [1, 2]}
var obj3 := {"one": 1, "two": [1, 2, 3]}
SxContainer.are_dictionaries_equal(obj1, obj2) # => true
SxContainer.are_dictionaries_equal(obj1, obj3) # => false
var obj1 := [1, 2]
var obj2 := [1, 2]
var obj3 := [1, 2, 3]
SxContainer.are_arrays_equal(obj1, obj2) # => true
SxContainer.are_arrays_equal(obj1, obj3) # => false
SxDebugConsole
Inherits: MarginContainer
Interactive in-game console.
- Description
-
Interactive in-game console.

Methods
|
|
SxDebugTools
Inherits: CanvasLayer
Global debug tools, showing debug information.
- Description
-
Global debug tools, showing debug information:
-
Debug info: shows performance info at the top-left section of the screen
-
Log details: scrollable logs (only those printed with SxLog, not print)
-
Node tracer: show currently enabled node tracers (see SxNodeTracer)
-
Scene tree dumps: show nodes currently in the scene tree, with support for the scene tree embedded in the SxListenServerPeer node
-
In-game console: execute commands to interact with the game (see SxDebugConsole)
-

Enumerations
enum SxDebugTools.PanelType:
-
DEBUG_INFO = 0 --- Debug info panel.
-
LOG = 1 --- Log panel.
-
NODE_TRACER = 2 --- Node tracer panel.
-
SCENE_TREE_DUMP = 3 --- Scene tree dump panel.
Methods
|
|
|
|
|
|
|
|
Method Descriptions
-
void show ()
Show the debug tools.
-
void hide ()
Hide the debug tools.
-
void toggle ()
Toggle the debug tools visibility.
-
void show_specific_panel ( SxDebugTools.PanelType panel_type )
Show a specific panel type.
If the main panel is hidden, nothing will be shown so you need to also call
show
.
SxDoubleTap
Inherits: Node
Double-tap detector.
- Description
-
Double-tap detector, useful for mobile environments.
Signals
-
doubletap ( int touch_idx )
Event emitted on double-tap.
SxFaButton
Inherits: Button
FontAwesome button, displaying an icon.
- Description
-
FontAwesome button, displaying an icon.
Make sure you read the docs about JSON before using the component.

SxFaFont
Inherits: Reference
Font management wrapper around FontAwesome.
- Description
-
Font management wrapper around FontAwesome.
Make sure you read the docs about JSON before using the component.
Methods
|
|
|
Method Descriptions
-
static DynamicFont create_fa_font ( int family, int size )
Lazily create a FontAwesome font, using a specific font family and a size.
If the font already exists, it will be returned.
If not, it will be created.
SxFaLabel
Inherits: Label
FontAwesome label, used to easily display a FontAwesome icon.
- Description
-
FontAwesome label, used to easily display a FontAwesome icon.
Make sure you read the docs about JSON before using the component.
SxFadingRichTextEffect
Inherits: RichTextEffect
A per-character fade-in effect.
- Description
-
A per-character fade-in effect.
SxFadingRichTextLabel
Inherits: RichTextLabel
A wrapped RichTextLabel with a per-character fade-in effect.
- Description
-
A wrapped RichTextLabel with a per-character fade-in effect.

Enumerations
enum SxFadingRichTextLabel.Alignment:
-
LEFT = 0 --- Left align.
-
RIGHT = 1 --- Right align.
Methods
|
|
|
|
Property Descriptions
-
bool autoplay
Autoplay the text animation.
-
float char_delay
Delay per character, in seconds.
-
float fade_out_delay
Fade out delay, in seconds.
-
SxFadingRichTextLabel.Alignment text_alignment
Text alignment.
Method Descriptions
-
void fade_in ()
Start the "fade in" animation.
-
void update_text ( String text )
Update text to display and reset the animation.
It will not automatically replay the animation, even withautoplay
set.
var label := $MyLabel as SxFadingRichTextLabel
label.update_text("Hello!")
label.fade_in()
SxFullScreenAcceptDialog
Inherits: SxFullScreenDialog
A full-screen accept dialog, useful for mobile environment.
- Description
-
A full-screen accept dialog, useful for mobile environment.

SxFullScreenConfirmationDialog
Inherits: SxFullScreenDialog
A full-screen confirmation dialog, useful for mobile environment.
- Description
-
A full-screen confirmation dialog, useful for mobile environment.

SxFullScreenDialog
Inherits: Panel
A full-screen dialog, useful for mobile environment.
- Description
-
A full-screen dialog, useful for mobile environment.
SxFullScreenFileDialog
Inherits: SxFullScreenDialog
A full-screen file selection dialog, useful for mobile environment.
- Description
-
A full-screen file selection dialog, useful for mobile environment.
Uses SxItemList and SxDoubleTap.

Enumerations
enum SxFullScreenFileDialog.Mode:
-
OPEN_FILE = 0 --- Open mode.
-
SAVE_FILE = 1 --- Save mode.
Methods
|
|
Property Descriptions
-
SxFullScreenFileDialog.Mode mode
File mode (open or save).
-
Dictionary shortcuts
Shortcuts to show.
-
String file_filter
File filter.
SxFullScreenFileDialog.PathShortcut
Inherits: Object
- Description
-
Path shortcut displayed in the dialog.
Methods
|
|
Method Descriptions
-
SxFullScreenFileFialog.PathShortcut from_dict ( Dictionary d )
Build a shortcut from JSON data.
SxFxBetterBlur
Inherits: Control
A ready-to-use gaussian blur, compatible with GLES2.
- Description
-
A ready-to-use gaussian blur, compatible with GLES2.

SxFxCamera
Inherits: Camera2D
A custom 2D camera with included effects.
- Description
-
A custom 2D camera with included effects.
Enumerations
enum SxFxCamera.Direction:
-
LEFT = 0 --- Left direction.
-
RIGHT = 1 --- Right direction.
-
UP = 2 --- Up direction.
-
DOWN = 3 --- Down direction.
Methods
|
|
|
|
|
|
|
|
Property Descriptions
-
float max_shake_strength
Max screen shake strength.
-
float shake_ratio
Shake ratio.
Method Descriptions
-
void viewport_scroll ( Vector2 top_left, SxFxCamera.Direction direction, float speed = 0.65, int easing = Tween.TRANS_QUAD )
Play a viewport scroll effect (quickly scroll to the "next screen").
-
void reset_limits ()
Reset the camera limits to arbitrary large values.
-
void set_limit_from_rect ( Rect2 rect )
Set the camera limits from Rect2 values.
SxFxChromaticAberration
Inherits: ColorRect
A simple chromatic aberration effect.
- Description
-
A simple chromatic aberration effect.

SxFxDissolve
Inherits: ColorRect
A ready-to-use dissolve effect.
- Description
-
A ready-to-use dissolve effect.

SxFxMotionBlur
Inherits: ColorRect
A ready-to-use motion blur.
- Description
-
A ready-to-use motion blur.

SxFxShockwave
Inherits: ColorRect
An animated shockwave effect.
- Description
-
An animated shockwave effect.

Methods
|
|
SxFxVignette
Inherits: ColorRect
A vignette effect.
- Description
-
A vignette effect.

SxGameData
Inherits: Node
A general-purpose in-memory key-value store, to be used through inheritance and autoload.
- Description
-
A general-purpose in-memory key-value store, to be used through inheritance and autoload.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Property Descriptions
-
String default_file_path
Default file path used in the
persist_to_disk
andload_from_disk
methods.
Method Descriptions
-
Variant load_static_value ( String name, Variant orDefault = null, String category = default )
Load static value from game data.
Static data is not persisted to disk.Examplevar levels = data.load_static_value("levels", Dictionary()) # returns a new Dictionary if key is missing var levels2 = data.load_static_value("my_data", Dictionary(), "my_category")
-
Variant load_temporary_value ( String name, Variant orDefault = null, String category = default )
Load temporary value from game data.
Temporary data is not persisted to disk.Examplevar tmp = data.load_temporary_value("foo") var tmp2 = data.load_temporary_value("foo", "default", "my_category") # returns the "default" string if key is missing
-
void persist_to_disk ( String path )
Persist game data to disk at a specific path.
If no path is given to the method, it will uses thedefault_file_path
attribute.Exampledata.persist_to_disk() data.persist_to_disk("user://my_path.dat")
-
void load_from_disk ( String path )
Load game data from disk at a specific path.
If no path is given to the method, it will uses thedefault_file_path
attribute.Exampledata.load_from_disk() data.load_from_disk("user://my_path.dat")
-
void clear_all ()
Clear all non-static data.
-
void clear_category ( String category )
Clear all non-static data for a specific category.
-
String dump_all ()
Dump each variable to string.
SxInput
Inherits: Reference
Input helpers.
- Description
-
Generic input helpers.
Methods
|
Method Descriptions
For example, if you want to handle a joystick action named move
, you need to register:
- move_left
, move_right
, move_up
, move_down
Or if your joystick action is named aim
:
- aim_left
, aim_right
, aim_up
, aim_down
# If `aim_up` strength is 0.5 and `aim_left` strength is 0.5 for example
var movement := SxInput.get_joystick_movement("aim")
# => movement = Vector2(-0.5, 0.5)
SxItemList
Inherits: ItemList
A touch-compatible ItemList.
- Description
-
A touch-compatible ItemList.
From https://github.com/godotengine/godot-proposals/issues/2429
SxJson
Inherits: Reference
JSON helpers.
- Description
-
Generic JSON helpers.
Methods
|
|
|
|
|
|
Method Descriptions
# If in this case you know your JSON is in object form, you can cast it to a Dictionary
var data := SxJson.read_json_file("res://my_json_data.json") as Dictionary
var file := File.new()
var error := file.open("res://my_json_data.json")
if error == OK:
# Now that the file is opened, you can use the method
var json_data = SxJson.read_json_from_open_file(file)
var my_data := {"one": 1}
SxJson.write_json_file(my_data, "user://my_data.json")
SxListenServerPeer
Inherits: Node
Configurable network peer, embedded in a SceneTree: a listen server.
- Description
-
Configurable network peer, embedded in a SceneTree: a listen server.
Methods
|
Property Descriptions
-
int server_port
Server port.
-
int max_players
Max players allowed to join.
-
bool use_websockets
Use a WebSockets server (instead of ENet).
Method Descriptions
-
Node get_server_root ()
Get the root node from the inner SceneTree.
-
SceneTree get_server_tree ()
Get the inner SceneTree.
-
SxServerPeer get_server ()
Get the server peer.
SxLoadCache
Inherits: Node
A resource/scene loader, exposing a load_resources
method to implement through inheritance and autoload.
- Description
-
A resource/scene loader, exposing a
load_resources
method to implement through inheritance and autoload.
Useful to load every needed resources at game startup.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
-
void load_resources ()
Load resources in cache.
Should be overriden by child classes.
-
PackedScene load_scene ( String scene_name )
Load a stored scene.
Examplevar cache := SxLoadCache.new() var scene := cache.load_scene("MyScene")
SxLog
Inherits: Reference
Log facility.
- Description
-
Generic log facility.
extends Node
var logger := SxLog.get_logger("MyNode")
func _ready() -> void:
logger.info("Node is ready!")
func boom() -> void:
logger.error("Node has exploded!")
Enumerations
enum SxLog.LogLevel:
-
TRACE = 0 --- Trace log level (lower level).
-
DEBUG = 1 --- Debug log level.
-
INFO = 2 --- Info log level.
-
WARN = 3 --- Warning log level.
-
ERROR = 4 --- Error log level.
-
CRITICAL = 5 --- Critical log level (higher level).
Methods
|
|
|
|
|
|
Method Descriptions
-
static SxLog.Logger get_logger ( String name )
Get or create a specific logger by its name.
var logger := SxLog.get_logger("MyLogger")
logger.info("Hello!")
-
static void configure_log_levels ( String conf )
Configure log levels for each loggers using a configuration string.
SxLog.configure_log_levels("info,my_logger=debug")
# => 1. Default log level for each logger will be "info"
# => 2. But the "my_logger" logger will have its log level to "debug"
SxLog.set_max_log_level("my_logger", SxLog.LogLevel.WARN)
# => The "my_logger" logger will have its log level to "warn"
SxLog.Logger
Inherits: Reference
- Description
-
Single logger handle.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Property Descriptions
-
String name
Name of the logger.
-
int max_level
Max log level.
-
bool display_in_console
Determine if the logger should display its content in standard console.
Method Descriptions
-
SxLog.Logger SxLog.Logger ( String name, int max_level, bool display_in_console )
Creates a new logger.
-
void set_max_log_level ( int level )
Set max log level for this logger.
SxMath
Inherits: Reference
Math helpers.
- Description
-
Generic math helpers.
Methods
|
|
|
|
|
|
|
Method Descriptions
var vec3 := SxMath.lerp_vector3(vec1, vec2, 0.25)
var xform := SxMath.align_with_y(transform, Vector3(1, 1, 1))
var xform := SxMath.interpolate_align_with_y(transform, Vector3(1, 1, 1), 0.25)
# Change the value 10 from bounds (0, 10) to bounds (0, 1)
var n := SxMath.map(10, 0, 10, 0, 1)
# => n = 1
# Change the value 5 from bounds (0, 10) to bounds (0, 1)
var n := SxMath.map(5, 0, 10, 0, 1)
# => n = 0.5
SxMusicPlayer
Inherits: Node
A music player, used to play sound tracks during the game.
- Description
-
A music player, used to play sound tracks, to be used through inheritance as an autoload (see [_sxaudiofxplayer]).
Methods
|
|
|
|
|
|
Property Descriptions
-
float global_volume_db
Used to query/set the global volume
Method Descriptions
-
void fade_in ( float duration = 0.5 )
Apply a "fade in" effect on sound with an optional duration in seconds.
# Suppose we have an instance of `SxMusicPlayer` as an autoload named `GameMusicPlayer`.
GameMusicPlayer.fade_in()
-
void fade_out ( float duration = 0.5 )
Apply a "fade out" effect on sound with an optional duration in seconds.
# Suppose we have an instance of `SxMusicPlayer` as an autoload named `GameMusicPlayer`.
GameMusicPlayer.fade_out()
-
void play_stream ( AudioStream stream )
Play an audio stream.
# Suppose we have an instance of `SxMusicPlayer` as an autoload named `GameMusicPlayer`.
GameMusicPlayer.play_stream(my_sound)
SxNetwork
Inherits: Reference
Network helpers.
- Description
-
Generic network helpers.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
# Script for a random node
extends Node
func _ready() -> void:
# Get the current network ID
var my_id := SxNetwork.get_nuid(self, NodePath(""))
# Script for a random node
extends Node
@rpc func _on_master_call():
# Get the sender network ID
var sender_id := SxNetwork.get_sender_nuid(self, NodePath(""))
# Script for a random node
extends Node
@rpc func _on_remote_call():
# Am I root?
if SxNetwork.is_root(self, NodePath("")):
print("Yay!")
var name = SxNetwork.generate_network_name("MyNode", "60b9798a-e989-4a74-8b78-d2fe544fcca2")
# => name = "MyNode#60b9798a-e989-4a74-8b78-d2fe544fcca2"
# Edge case: if the name and the GUID is the same value, only one is kept.
var name = SxNetwork.generate_network_name("60b9798a-e989-4a74-8b78-d2fe544fcca2", "60b9798a-e989-4a74-8b78-d2fe544fcca2")
# => name = "60b9798a-e989-4a74-8b78-d2fe544fcca2"
func _ready() -> void:
if SxNetwork.is_multiplayer_authority(self, NodePath("")):
print("I have the control!")
func _ready() -> void:
var master_id := SxNetwork.get_multiplayer_authority(self, NodePath(""))
func _ready() -> void:
var is_server := SxNetwork.is_server(get_tree(), NodePath(""))
func _ready() -> void:
var is_network_peer_on := SxNetwork.is_network_enabled(get_tree(), NodePath(""))
-
static String uuid4 ()
Generate a UUID4 string.
var uuid = SxNetwork.uuid4()
# => uuid = "60b9798a-e989-4a74-8b78-d2fe544fcca2"
SxNode
Inherits: Reference
Node helpers.
- Description
-
Generic node helpers.
Methods
|
|
|
SxNodeTracer
Inherits: Node
A tracing node, useful to display debug values.
- Description
-
A tracing node, useful to display debug values.
It is shown through the SxDebugTools, in the "Node tracer" section.
To add a node tracer, just instance a
SxNodeTracer
in your scene, and use thetrace_parameter
function to register a parameter with a value (you will need to call it at each value update).Exampleextends Node # Suppose your node have a SxNodeTracer as a child onready var _tracer := $SxNodeTracer as SxNodeTracer func _ready(): # Let's display... the child count? _tracer.trace_parameter("children", len(get_children()) func _process(delta: float) -> void: # And show the node position, updated at each _process call _tracer.trace_parameter("position", position)
Methods
|
|
Property Descriptions
-
String title
A custom node title, if set.
If not set, uses the parent node name.
Method Descriptions
-
void trace_parameter ( String name, Variant value )
Create or update a parameter trace, to display through the SxDebugTools node tracer panel.
If you need to continuously update a value, call
trace_parameter
in your node_process
method.
SxOs
Inherits: Reference
OS methods.
- Description
-
Generic OS methods.
Methods
|
|
|
|
|
|
|
Method Descriptions
-
static void set_window_size_str ( String window_size )
Set the current window size from a "WIDTHxHEIGHT" string.
SxOs.set_window_size_str("1280x720")
-
static bool is_mobile ()
Detect if the current system is a mobile environment.
if SxOs.is_mobile():
print("I'm on a mobile!")
-
static bool is_web ()
Detect if the current system is a Web environment.
if SxOs.is_web():
print("I'm on a browser!")
-
static Array list_files_in_directory ( String path, Array filters )
List all files in a directory.
Thefilters
argument is used to ignore some patterns.It returns an array of SxOs.DirOrFile.
var files_and_dirs = SxOs.list_files_in_directory("user://my_folder", []):
SxOs.DirOrFile
Inherits: Reference
- Description
-
Represents a path: a directory or a file.
Enumerations
enum SxOs.DirOrFile.Type:
-
DIRECTORY = 0 --- Path is a directory.
-
FILE = 1 --- Path is a file.
Methods
|
|
|
SxRand
Inherits: Reference
Rand methods.
- Description
-
Generic rand methods.
Methods
|
|
|
|
|
|
|
Method Descriptions
var n := SxRand.range_i(1, 2)
var n := SxRand.range_vec2(Vector2.ZERO, Vector2.ONE)
-
static Vector2 unit_vec2 ()
Generate a random unit Vector2.
var n := SxRand.unit_vec2()
# 75% chance!
var n := SxRand.chance_bool(75)
var v := SxRand.choice_array([1, 2, 3])
SxRpcService
Inherits: Node
Main RPC interface.
- Description
-
Main RPC interface.
Methods
|
Property Descriptions
-
SxClientRpc client
Access to the client RPC interface.
-
SxServerRpc server
Access to the server RPC interface.
-
SxSyncInput sync_input
Access to the synchronized input interface.
Method Descriptions
-
static SxRpcService get_from_tree ( SceneTree tree )
Return the main RPC service for a target SceneTree.
SxSceneRunner
Inherits: Control
Scene runner.
- Description
-
Simple scene runner, can be used as a test suite.
Inherit the scene, define ascene_folder
, then you can navigate scenes.

Signals
-
scene_loaded ( String name )
A scene has been loaded.
-
go_back ()
A "go-back" navigation request has been made.
SxSceneTransitioner
Inherits: CanvasLayer
A simple scene transition node, with a fade-in/fade-out effect.
- Description
-
A simple scene transition node, with a fade-in/fade-out effect.

Methods
|
|
|
|
|
|
|
|
|
Method Descriptions
-
void fade_to_scene ( PackedScene scene, float speed = 1.0 )
Fade the current scene to another already-loaded scene.
# Suppose the node is autoloaded as GameSceneTransitioner.
GameSceneTransitioner.fade_to_scene(my_scene)
# Suppose the node is autoloaded as GameSceneTransitioner.
GameSceneTransitioner.fade_to_scene_path("res://my_scene.tscn")
-
void fade_to_cached_scene ( SxLoadCache cache, String scene_name, float speed = 1.0 )
Fade the current scene to another cached scene, using a SxLoadCache.
# Suppose the node is autoloaded as GameSceneTransitioner.
# Suppose an SxLoadCache is autoloaded as GameSceneCache.
GameSceneTransitioner.fade_to_cached_scene(GameSceneCache, "MyScene")
-
void fade_in ( float speed = 1.0 )
Apply a "fade in" effect.
# Suppose the node is autoloaded as GameSceneTransitioner.
GameSceneTransitioner.fade_in()
-
void fade_out ( float speed = 1.0 )
Apply a "fade out" effect.
# Suppose the node is autoloaded as GameSceneTransitioner.
GameSceneTransitioner.fade_out()
SxServerPeer
Inherits: Node
Configurable network peer, server side.
- Description
-
Configurable network peer, server side.
Signals
-
peer_connected ( int peer_id )
On a distant peer connection.
-
peer_disconnected ( int peer_id )
On a distant peer disconnection.
-
players_updated ( Dictionary players )
On players data update (for example a username change).
Methods
|
|
|
|
|
|
|
|
|
|
|
|
Property Descriptions
-
int server_port
Server port.
-
int max_players
Max players allowed to join.
-
bool use_websockets
Use a WebSockets server (instead of ENet).
-
SxRpcService rpc_service
Access to the RPC service.
Method Descriptions
-
Dictionary get_players ()
Get known players data.
-
Node spawn_synchronized_scene ( NodePath parent, String scene_path, int owner_peer_id = 1, Dictionary master_configuration = {} )
Spawn a synchronized scene on the server, with replicas sent to connected clients.
-
Node spawn_synchronized_scene_mapped ( NodePath parent, String name, String server_scene_path, String client_scene_path, int owner_peer_id = 1, Dictionary master_configuration = {} )
Spawn a synchronized named scene on the server using a specific scene path for the server and a different path for the client.
This method is useful if you want to mimic the server nodes on the client with different scene paths.
-
void remove_synchronized_node ( Node node )
Remove a node from the server and the connected clients.
-
bool is_quitting ()
Check if the server is in the shutdown procedure.
It can be useful to cleanup stuff before the server quits.
-
bool set_quit_status ()
Change the "quit" status of the server.
SxServerPeer.SxSynchronizedScenePath
Inherits: Reference
- Description
-
A synchronized scene path: wrapper around a scene creation for network dispatch.
SxServerRpc
Inherits: Node
Server RPC interface.
- Description
-
Server RPC interface.
Methods
|
|
|
|
|
|
Method Descriptions
-
void ping ()
Send a "ping" event to the server.
-
void send_input ( Dictionary input )
Send player input to the server.
-
void update_player_username ( String username )
Send new username to the server.
SxShader
Inherits: Reference
Shader methods.
- Description
-
Generic shader methods.
Methods
|
|
|
|
Method Descriptions
-
static Variant get_shader_parameter ( CanvasItem item, String name )
Get a shader param from a canvas item.
Handles edge cases like missing material or non-shader material.
var param := SxShader.get_shader_param($MyNode, "ratio") as float
-
static void set_shader_parameter ( CanvasItem item, String name, Variant value )
Set a shader param on a canvas item.
Handles edge cases like missing material or non-shader material.
SxShader.set_shader_param($MyNode, "ratio", 0.25)
SxSyncBarrier
Inherits: Node
Simple network barrier.
- Description
-
Simple network barrier.
Enumerations
enum SxSyncBarrier.BarrierJoinStatus:
-
NOT_READY = 0 --- Barrier is waiting for clients.
-
OK = 1 --- Barrier is ready, all clients are ready.
-
TIMEOUT = 2 --- Barrier have timed out.
Methods
|
|
|
|
Method Descriptions
-
void set_server_peer ( SxServerPeer peer )
Set the server peer for the barrier (mandatory before using it).
-
void await_peers ()
Wait for each peers to connect, or wait for the timeout.
This method will remove the barrier on completion/timeout.
SxSyncInput
Inherits: Node
Synchronized input interface.
- Description
-
Synchronized input interface.
Methods
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
-
SxSyncPeerInput get_current_input ()
Get the current player input.
-
void create_peer_input ( int peer_id )
Create a peer input for a specific peer ID.
-
void remove_peer_input ( int peer_id )
Remove a peer input for a specific peer ID.
-
void update_peer_input_from_json ( int peer_id, Dictionary input )
Update peer input state from a JSON dict.
SxSyncPeerInput
Inherits: Node
Synchronized input interface for a specific peer.
- Description
-
Synchronized input interface for a specific peer.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
-
Dictionary to_json ()
Convert each input state to JSON.
-
void update_from_json ( Dictionary input )
Update each input state from JSON data.
-
void query_input ()
Update the sync input from local input state.
SxSyncPeerInput.InputState
Inherits: Object
- Description
-
No description.
Methods
|
|
|
|
Property Descriptions
-
bool pressed
"Pressed" status for an input.
-
bool just_pressed
"Just pressed" status for an input.
-
float strength
Strength for an input.
Method Descriptions
-
Dictionary to_json ()
Convert an input state to JSON.
-
void update_from_json ( Dictionary d )
Update an input state from JSON data.
SxText
Inherits: Reference
Text methods.
- Description
-
Generic text methods.
Methods
|
|
|
SxTileMap
Inherits: Reference
Tilemap methods.
- Description
-
Generic tilemap methods.
Methods
|
|
|
|
|
|
|
|
|
|
|
|
Method Descriptions
var r := SxTileMap.get_cell_rotation(tilemap, Vector2(0, 0))
-
static SxTileMap.CellRotationParams get_cell_rotation_params ( TileMap tilemap, Vector2 pos )
Get a specific cell rotation, in a custom class format.
var params := SxTileMap.get_cell_rotation_params(tilemap, Vector2(0, 0))
-
static float rotation_params_to_angle ( SxTileMap.CellRotationParams params )
Convert rotation params to an angle in radians.
var params := SxTileMap.get_cell_rotation_params(tilemap, Vector2(0, 0))
var angle := SxTileMap.rotation_params_to_angle(params)
-
static SxTileMap.CellRotationParams rotation_degrees_to_params ( int angle_degrees )
Generate cell rotation parameters from an angle in degrees.
var params := SxTileMap.rotation_degrees_to_params(90)
-
static PoolIntArray create_dump ( TileMap tilemap )
Create a dump from tilemap contents.
var tile_data := SxTileMap.create_dump(tilemap)
-
static void apply_dump ( TileMap tilemap, PoolIntArray array )
Overwrite tilemap contents with a dump.
Before applying the dump, it will clear all the tilemap contents.
SxTileMap.apply_dump(tilemap, my_dump)
SxTileMap.CellRotationParams
Inherits: Node
- Description
-
Helper class representing transpose/flip parameters for a TileMap cell.
Methods
|
Property Descriptions
-
bool transpose
Is the cell transposed?
-
bool flip_x
Is the cell flipped on axis X?
-
bool flip_y
Is the cell flipped on axis Y?
Method Descriptions
-
static SxTileMap.CellRotationParams from_values ( bool transpose, bool flip_x, bool flip_y )
Build rotation params from transpose, flip_x and flip_y parameters.
SxUi
Inherits: Reference
UI methods.
- Description
-
Generic UI methods.
Methods
|
|
|
|
Method Descriptions
-
static void set_full_rect_no_mouse ( Control node )
Apply a "Wide" anchors and margin preset to a Control node, with an "Ignore" mouse filter.
-
static void set_margin_container_margins ( MarginContainer node, float value )
Apply an uniform margin on all sides for a MarginContainer.
SxVirtualButton
Inherits: TextureRect
Virtual button to be included in a SxVirtualControls.
- Description
-
Virtual button to be included in a SxVirtualControls.
SxVirtualControls
Inherits: Control
A simple virtual controls module.
- Description
-
A simple virtual controls module.
You only need to create a new scene, inheriting from
SxVirtualControls
, and then instancing your controls in it (adding SxVirtualButtons and SxVirtualJoysticks).On buttons, you can affect an action key (mapped in the Input Map), and on joysticks, you can affect 4 actions keys, one for each direction.
You have 3 samples at your disposal in the plugin.

Enumerations
enum SxVirtualControls.DisplayMode:
-
OnlyMobile = 0 --- Only display the controls on a mobile environment.
-
Always = 1 --- Always display the controls, in desktop or mobile.
SxVirtualJoystick
Inherits: TextureRect
Virtual joystick to be included in a SxVirtualControls.
- Description
-
Virtual joystick to be included in a SxVirtualControls.
Signals
-
changed ( Vector2 movement )
The joystick value has changed.
-
touched ()
The button was touched.
-
released ()
The button was released.