Game/App Integrations

Adding SignalRGB support to your app or game is quick and easy. If your project can send HTTP POST requests, it can take advantage of SignalRGB's wide range of compatible devices.

There are two main ways your app or game can integrate with SignalRGB: triggering pre-existing effects or communicating with a custom effect you develop. The first option requires much less development time but is limited to our library of premade effects. The second approach may take more time, but it opens up endless possibilities for the types and number of effects you can create.

Ultimately, it’s up to you as the developer to decide which approach is best for your project. However, both methods can deliver fantastic lighting experiences..

Game Effect Library

If you prefer not to develop your own lighting effects, you can take advantage of our extensive library of pre-made effects. Using SignalRGB app URLs, you can easily install and activate any public lighting effect available for download from SignalRGB.

It’s recommended that you install the lighting effects your app or game will activate when it first launches to ensure all effects are triggered quickly.

The following API routes are available to assist with this:

Request URIPurpose
signalrgb://effect/install/EffectNameInstall the lighting effect named EffectName
signalrgb://effect/apply/EffectNameActivate the lighting effect named EffectName

Effect names are case-sensitive, and any special characters must be URL encoded. For example, any spaces should be replaced with %20.

If your chosen engine or language cannot communicate with custom URL protocol handlers, you can still use this portion of the SignalRGB API. Simply start the SignalRgbLauncher.exe executable located in C:\Users\<username>\AppData\Local\VortxEngine with --url argument set to the path of the API route you'd like to use. To prevent the app from being brought to the foreground, you can add ?-silentlaunch-.

For example, to install the effect named Azure, you would launch the executable with the following argument:

SignalRgbLauncher.exe --url=effect/apply/Azure?-silentlaunch-

Unity

Unreal Engine

The following C++ class can be used with Unreal Engine to install and activate any SignalRGB effect.

SignalEffectApi.cpp
SignalEffectApi.h
Copy

It is recommended that you install any effects you wish to use when your app launches so that effects can be triggered quickly.

The following example shows how you can install and activate an effect using the SignalEffectApi class.

C++
Copy

Custom Effects

Communicating with SignalRGB directly using HTTP requests is easy to accomplish once you know how the requests are structured. The structure of the request is as follows:

Request type: POST

Request URI: http://localhost:16034/canvas/event?sender=your-app-name&event=your-event

All commands sent from your app should use the same sender variable. The event variable is where the data being passed to SignalRGB should go.

Inside the effect, all data is sent through the onCanvasApiEvent function. Use this function to handle how your effect responds to HTTP requests.

Example Code

This basic example shows how a Unity or Unreal Engine game can communicate with SignalRGB to trigger events in a custom lighting effect. However, any method of sending HTTP requests can be used to control the custom lighting effect. This flexibility means that SignalRGB support can be added to almost any game or application.

Lighting Effect

All events sent to the API route are passed to the lighting effect through the onCanvasApiEvent function. There are many ways to manage events, but the following example keeps things simple and easy to understand. If you’re developing something more complex with multiple events, consider using the state handler method to track the events and their corresponding lighting effects.

Javascript
Copy

Unity

A function like the following will allow Unity to communicate with SignalRGB. However, any method of sending HTTP POST requests can be used.

Unity
Copy

Unreal Engine

The following C++ class can be used with Unreal Engine to enable communication via the SignalRGB API. Make sure to change the sender parameter of the request URI to match what your lightscript is using.

SignalApi.cpp
SignalApi.h
Copy

To trigger a lighting effect in your game's code, simply call the SendEvent function specifying the name of the event you'd like to trigger, along with the name your app or game will use to identify itself to SignalRGB.

C++
Copy

You must add the Http module to your Unreal Engine build dependencies by editing ProjectName.Build.cs to resemble the following:

ProjectName.Build.cs
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard