Skip to content

mge⚓︎

The mge library accesses MGE XE functionality, including control over shaders. Many older functions have been deprecated.

Properties⚓︎

mge.camera⚓︎

Allows control of MGE camera features.

Returns:


mge.distantLandRenderConfig⚓︎

Allows control of the camera.

Returns:


mge.render⚓︎

Allows control of render features.

Returns:


mge.shaders⚓︎

Allows control of shaders.

Returns:


mge.weather⚓︎

Allows control of MGE weather features.

Returns:


Functions⚓︎

mge.enabled⚓︎

Determines if the MGE XE interface is enabled.

local enabled = mge.enabled()

Returns:

  • enabled (boolean)

mge.getLightingMode⚓︎

Returns the lighting mode used by MGE XE. These values map to mge.lightingMode constants.

local mode = mge.getLightingMode()

Returns:


mge.getUIScale⚓︎

Returns the GUI scaling used by MGE XE.

local scale = mge.getUIScale()

Returns:

  • scale (number)

mge.getVersion⚓︎

Gets the MGE version. Returns a table with keys major, minor, and patch.

local result = mge.getVersion()

Returns:


mge.loadConfig⚓︎

Reloads the MGE config file. This is primarily an internal function and shouldn't be called casually.

mge.loadConfig()

mge.reloadDistantLand⚓︎

Reloads the MGE distant land. This is a blocking call that can take some seconds.

mge.reloadDistantLand()

mge.saveConfig⚓︎

Saves the MGE config file. This is primarily an internal function and shouldn't be called casually.

mge.saveConfig()

mge.saveScreenshot⚓︎

Saves a screenshot.

mge.saveScreenshot({ path = ..., captureWithUI = ... })

Parameters:

  • params (table)
    • path (string)
    • captureWithUI (boolean): Default: false. If set to true, the screenshot will include the user interface.

mge.setLightingMode⚓︎

Sets the lighting mode used by MGE XE. The values passed can be used from the mge.lightingMode constants.

mge.setLightingMode(mode)

Parameters:


mge.setUIScale⚓︎

Sets the GUI scaling used by MGE XE.

mge.setUIScale(scale)

Parameters:

  • scale (number)