Class:DataModel

From OpenBlox
Jump to: navigation, search
This page contains changes which are not marked for translation.

Other languages:
English
DataModel
uncreatable
Inheritance
ServiceProvider
Instance

All OpenBlox games have a singleton DataModel Instance which provides, as a ServiceProvider, access to all the game services. It is designated in scripts by the global variables Game and game.

Properties

boolean RobloxCompatMode

The value of this property determines whether or not Roblox compatibility mode is enabled. This defaults to false, but could be true on load if the file opened was in Roblox XML format.

Methods

void SetTitle(string title)

This method sets the title of the game window to the value provided by title.

string GetTitle()

This method returns the title of the game window.

boolean IsLoaded()

This method returns true if the DataModel is loaded, otherwise false. Currently, this method is a stub.

string GetMessage()

This method returns the status message of the DataModel.

void SetMessage(string title)

This method sets the status message of the DataModel to title.

void ClearMessage()

This method clears the status message of the DataModel.

void Shutdown(int statusCode)

This method shuts down the DataModel, and causes the game to exit. The statusCode is set, some client implementations return that as an exit code to the operating system. If it is not set, 0 is used.

double GetFPS()

This method returns the last recorded FPS (frames per second). On the server, this will always return -1.

Events

Loaded()

This event is fired when the DataModel is loaded. This happens any time a file is loaded (with internal engine methods) or all known Instances are downloaded from a server.