System API Reference

The system API lives in the castle.system module. The Castle sytem API lets you access information about or perform activities relating to the underlying system Castle is running on.

castle.system.isDesktop()

Returns true if running on a user's desktop (Windows or macOS) system, false otherwise.

castle.system.isRemoteServer()

Returns true if running on a Castle remote multiplayer server, false otherwise.

castle.system.getGlobalScaling()

Returns a number which is the scaling factor of the user's system Castle is running on. This is equal to 1 on all systems other than Windows. On Windows this depends on the user's scale setting under "Display settings." It returns the fractional value corresponding to this percentage value. So, for example, if the user's setting is 125%, it returns 1.25.