Skip to content

API docs

MatusGuy edited this page May 7, 2022 · 21 revisions

Here you can find all about Mt objects and their composition

Hierarchy graph


MObject

This class is the base class for all Mt objects.

Members

Strikethroughed members are deprecated

Properties

Property Description Associated function
Name="object" Object name. SetName(string name)
ClassName="MObject" Object class.
OBJID=0 A number used to identify the object, so that the internal code doesn't have to compare tables all the time.
Parent={} Object parent. To set the parent to nothing, run MObject:SetParent({}). SetParent(MObject parent)
Children={} List of objects that have the object as a parent.
BlockEvents=false Blocks events from firing. Just change the property directly (MObject.BlockEvents = true or false)

PROTIP: Objects are just tables. To create a custom property, simply just run MObject["propertyName"] = propertyValue, and to call it run MObject.propertyName

Functions

Function Description
Init(MObject parent) Creates a new MObject and returns it.
FireEvent(Instance event) Fires an event applying the MObject.BlockEvents filter.
Destroy() Destroys the object.
Clone() Clones the object and returns it.
SetName(string name) Changes MObject.Name.
SetParent(MObject parent) Changes MObject.Parent.
FindFirstChild(string childName) Finds first child with childName in MObject.Children and returns it.
PrintMembers() Used for testing, prints all properties', functions' and events' names.

Events

Event Description
Destroyed Called right before running MObject:Destroy()

MRobloxInstance

Inherits from: MObject

This object is still in its prototype phase. When a roblox object is used by an MObject, an MRobloxInstance is created. This Mt object creates a roblox object and adds two attributes:

  • MtOBJID (The OBJID of the MObject that uses this roblox object)
  • MtKEY

MScreen

Inherits from: MObject

An MScreen is a place where you can put MWidgets.

To create an MScreen and place widgets in it, create a LocalScript and follow this sample code:

local repstrg = game:GetService("ReplicatedStorage")
local MScreen = require(repstrg.Mt.MtCore.MScreen)
local MWidget = require(repstrg.Mt.MtWidgets.MWidget)

local plr = game:GetService("Players").LocalPlayer -- get player

local screen = MScreen:Init(plr) -- create MScreen and link that MScreen to the player

local widget = MWidget:Init() -- create widget
widget:SetParent(screen) -- parent widget to screen
screen:AddWidget(widget) -- add widget to screen

Members

Properties

Property Description Associated function
Name="screen" See MObject's properties <---
ClassName="MScreen" ^^^
ScrX=1 i forgot what this was for
ScrY=1 ^^^
Player=nil The player that can see the MScreen
ScreenGui=nil The ScreenGui object used by the MScreen
Widgets={} List of all widget's OBJIDs in the MScreen. To get all the widget objects instead of OBJIDs, run MScreen:GetWidgets(). AddWidget(widget)/RemoveWidget(widget)

Clone this wiki locally