Class RomlObject
A wrapper for ROBLOX objects that contains methods for finding objects within the hierarchy.
Info:
- License: MIT
- Author: Richard Voelker
Methods
RomlObject.new (self, romlDoc, object, objectId[, classes={}]) | Create a new RomlObject. |
RomlObject.SetParent (self, parent) | Sets the parent of this RomlObject and updates any children lists. |
RomlObject.GetRobloxObject (self) | |
RomlObject.ObjectName (self) | |
RomlObject.Refresh (self) | Sets the properties of the RomlObject to its associated ROBLOX object, sending the properties through any filters if necessary. |
RomlObject.StyleObject (self, properties) | Changes the properties of the wrapped ROBLOX object without changing the inline properties of this object. |
RomlObject.AddChild (self, child) | Add a child RomlObject to this RomlObject. |
RomlObject.SetProperties (self, properties) | Sets the properties to the RomlObject. |
RomlObject.SetClasses (self, classes) | |
RomlObject.RemoveAllChildren (self) | Removes all children from this object. |
RomlObject.GetId (self) | |
RomlObject.GetObjectId (self) | |
RomlObject.GetClasses (self) | |
RomlObject.RemoveChild (self, child) | Remove the provided child from the list of children. |
RomlObject.HasClass (self, className) | Returns whether or not this RoML Object has the given class or not. |
RomlObject.MatchesSelector (self, selectorStack) | Returns whether or not this RoML Object matches the given Stack of selectors. |
RomlObject.AllowsChildren (self) | |
RomlObject.Find (self, selector) | Find RomlObjects within this RomlObject's hierarchy using the given selector. |
Methods
- RomlObject.new (self, romlDoc, object, objectId[, classes={}])
-
Create a new RomlObject.
Parameters:
- self RomlObject
- romlDoc RomlDoc The RomlDoc this object belongs to.
- object
Instance
The ROBLOX Instance to wrap with this
RomlObject.
- objectId string The ID assigned to this object.
- classes
table
The list of classes for the
(default {})RomlObject.
- RomlObject.SetParent (self, parent)
-
Sets the parent of this RomlObject and updates any children
lists.
Parameters:
- self RomlObject
- parent RomlObject The new parent.
Returns:
-
Instance
The ROBLOX object wrapped by this
RomlObject.
- RomlObject.GetRobloxObject (self)
-
Parameters:
- self RomlObject
Returns:
-
Instance
The ROBLOX object wrapped by this
RomlObject.
- string The name of this object.
- RomlObject.ObjectName (self)
-
Parameters:
- self RomlObject
Returns:
-
string
The name of this object.
- RomlObject.Refresh (self)
-
Sets the properties of the RomlObject to its associated
ROBLOX object, sending the properties through any filters if
necessary.
Parameters:
- self RomlObject
- RomlObject.StyleObject (self, properties)
-
Changes the properties of the wrapped ROBLOX object without
changing the inline properties of this object.
Parameters:
- self RomlObject
- properties table The list of properties to set on the ROBLOX object.
- RomlObject.AddChild (self, child)
-
Add a child RomlObject to this RomlObject. Throws an error if
this RomlObject does not allow children.
Parameters:
- self RomlObject
- child RomlObject The child to add.
- RomlObject.SetProperties (self, properties)
-
Sets the properties to the RomlObject. The associated ROBLOX
object is not updated until Refresh is called.
Parameters:
- self RomlObject
- properties table The properties to set.
- RomlObject.SetClasses (self, classes)
-
Parameters:
- self RomlObject
- classes table The array of new classes.
- RomlObject.RemoveAllChildren (self)
-
Removes all children from this object.
Parameters:
- self RomlObject
Returns:
-
integer
The unique identifier for this RomlObject.
- RomlObject.GetId (self)
-
Parameters:
- self RomlObject
Returns:
- integer The unique identifier for this RomlObject.
- integer The named identifier for the RomlObject as defined in the RomlDoc.
- RomlObject.GetObjectId (self)
-
Parameters:
- self RomlObject
Returns:
- integer The named identifier for the RomlObject as defined in the RomlDoc.
- The style classes of this RomlObject.
- RomlObject.GetClasses (self)
-
Parameters:
- self RomlObject
Returns:
-
The
style classes of this RomlObject.
- RomlObject.RemoveChild (self, child)
-
Remove the provided child from the list of children.
Parameters:
- self RomlObject
- child RomlObject The child to remove.
- RomlObject.HasClass (self, className)
-
Returns whether or not this RoML Object has the given
class or not.
Parameters:
- self RomlObject
- className string The class to look for.
Returns:
-
bool
True if this RomlObject has the class, false
if it does not.
- RomlObject.MatchesSelector (self, selectorStack)
-
Returns whether or not this RoML Object matches the given
Stack of selectors. Each element of the Stack should
be a simple table with a object key, a id or class key, or
both.
Parameters:
- self RomlObject
- selectorStack Stack
Returns:
- bool True if the entire Stack matches this specific RomlObject, false otherwise.
- bool Whether or not this RomlObject can have children RomlObjects.
- RomlObject.AllowsChildren (self)
-
Parameters:
- self RomlObject
Returns:
-
bool
Whether or not this RomlObject can have
children RomlObjects.
- RomlObject.Find (self, selector)
-
Find RomlObjects within this RomlObject's hierarchy using the
given selector.
Parameters:
- self RomlObject
- selector string The selector to use as a search.
Returns:
-
table
Table of matching RomlObjects.