-
Notifications
You must be signed in to change notification settings - Fork 1
API docs
MatusGuy edited this page Jun 3, 2022
·
21 revisions
Here you can find all about Mt objects and their composition
-
MObject
- MRobloxInstance
- MScreen
- MWidget
- MWindow
- MProgressBar
- MWindowResizeRegion
This class is the base class for all Mt objects.
Strikethroughed members are deprecated
Property | Description | Associated function |
---|---|---|
Name:string="object" |
Object name. | SetName(string name) |
ClassName:string="MObject" |
Object class. | |
OBJID:number=0 |
A number used to identify the object, so that the internal code doesn't have to compare tables all the time. | |
Parent:MObject={} |
Object parent. To set the parent to nothing, run MObject:SetParent({}) . |
SetParent(MObject parent) |
Children:{MObject}={} |
List of objects that have the object as a parent. | |
BlockEvents:boolean=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
Function | Description |
---|---|
Init(MObject parent={}): MObject |
Creates a new MObject and returns it. |
FireEvent(Instance event) |
Fires an event applying the MObject.BlockEvents filter. |
Destroy() |
Destroys the object. |
Clone():MObject |
Clones the object and returns it. |
SetName(string name) |
Changes MObject.Name . |
SetParent(MObject parent) |
Changes MObject.Parent . |
FindFirstChild(string childName):MObject |
Finds first child with childName in MObject.Children and returns it. |
PrintMembers() |
Used for testing, prints all properties', functions' and events' names. |
Event | Description |
---|---|
Destroyed |
Called right before running MObject:Destroy()
|
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
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
Property | Description | Associated function |
---|---|---|
Name:string="screen" |
See MObject's properties | <--- |
ClassName:string="MScreen" |
^^^ | |
ScrX:number=1 |
i forgot what this was for | |
ScrY:number=1 |
^^^ | |
Player:Player=nil |
The player that can see the MScreen | |
ScreenGui:ScreenGui=nil |
The ScreenGui object used by the MScreen | |
Widgets:{MWidget}={} |
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)
|
Function | Description |
---|---|
Init(Player plr=game.Players.LocalPlayer, MObject parent={}): MScreen |
Creates and returns a new MScreen object. plr is the player that can see the GUI on that screen. |
SetName(string name) |
Changes names for the object and the screen's ScreenGui. |
AddWidget(MWidget widget) |
Adds a widget to the screen so that it becomes visible. |
RemoveWidget(MWidget widget) |
Removes a widget from the screen. |
GetWidgets(): {MWidget} |
Returns all widgets in the screen. |
GetScreenSize(): Vector2 |
Returns screen size in pixels. MWidget.ScreenGui.IgnoreGuiInset affects this value
|
GetScreenWidth(): number |
Uses MScreen:GetScreenSize() to get the X value of the screen size. |
GetScreenHeight(): number |
Uses MScreen:GetScreenSize() to get the Y value of the screen size. |
SetOverrideTopbar(boolean override) |
Changes MScreen.ScreenGui.IgnoreGuiInset to override
|
Inherits from: MScreen