Properties
Content
|
The image content displayed by the UI element. |
Color3
|
Determines how a rendered image will be colorized. |
Vector2
|
The offset in pixels of the sub-area of an image to be displayed |
Vector2
|
Determines the size in pixels of the sub-area of an image to be displayed. |
float
|
Determines the transparency of the rendered image |
bool
[ReadOnly]
[NotReplicated]
|
Indicates whether the Image has finished loading from the Roblox website. |
ScaleType
|
Determines how an image will scale if displayed in a UI element whose size differs from the source image. |
Rect
|
Determines the center of a nine-slice image. |
float
|
Scales the 9slice edges by the specified ratio |
UDim2
|
Sets the tiling size of the ImageLabel. |
Inherited from GuiObject: Show
bool
|
Determines whether a UI element sinks input |
Vector2
|
Determines the origin point of a |
AutomaticSize
|
BrickColor
[Hidden]
[NotReplicated]
[Deprecated]
|
Determines the color of a |
Color3
|
Determines a |
float
|
Determines the transparency of the |
BrickColor
[Hidden]
[NotReplicated]
[Deprecated]
|
Determines the color of a |
Color3
|
Determines the color of a |
BorderMode
|
Determines in what manner a GuiObject’s border is laid out relative to its dimensions. |
int
|
Determines the pixel width of a |
bool
|
Determines if descendant |
bool
[Deprecated]
|
Determines whether a |
int
|
Controls the sort order of a |
GuiObject
|
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction |
GuiObject
|
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction |
GuiObject
|
Sets the |
GuiObject
|
Sets the GuiObject which will be selected when the Gamepad selector is moved in this direction |
UDim2
|
Determines the pixel and scalar position of a |
float
|
Determines the number of degrees by which a UI element is rotated |
bool
|
Determine whether the |
GuiObject
|
Overrides the default selection adornment (used for gamepads) |
UDim2
|
Determine the pixel and scalar size of a |
SizeConstraint
|
Selects the |
float
[Hidden]
[NotReplicated]
|
A mixed property of BackgroundTransparency and TextTransparency |
bool
|
Determines whether a |
int
|
Determines the order in which a |
Inherited from GuiBase2d: Show
Vector2
[ReadOnly]
[NotReplicated]
|
Describes the actual screen position of a UI element, in pixels. |
float
[ReadOnly]
[NotReplicated]
|
Describes the actual screen rotation of a UI element, in degrees. |
Vector2
[ReadOnly]
[NotReplicated]
|
Describes the actual screen size of a UI element, in pixels. |
bool
|
When set to true, localization will be applied to this GuiBase2d and its descendants based on the |
bool
[Hidden]
[NotReplicated]
[Deprecated]
|
Automatically set to true when a LocalizationTable’s Root targets this object, or an ancestor of this object. |
LocalizationTable
|
A reference to a |
bool
|
Determines if an |
string
[ReadOnly]
[NotReplicated]
|
A read-only string representing the class this |
int
[ReadOnly]
[NotReplicated]
[Deprecated]
|
The cost of saving the instance using data persistence. |
string
|
A non-unique identifier of the |
Instance
[NotReplicated]
|
Determines the hierarchical parent of the |
bool
|
A deprecated property that used to protect |
bool
[Hidden]
[NotReplicated]
[Deprecated]
|
string
[ReadOnly]
[NotReplicated]
[Deprecated]
|
Functions
Inherited from GuiObject: Show
bool
|
Smoothly moves a GUI to a new |
bool
|
Smoothly resizes a GUI to a new |
bool
|
Smoothly moves a GUI to a new size and position |
void
|
This function destroys all of an |
Instance
|
Create a copy of an object and all its descendants, ignoring objects that are not |
void
|
Sets the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Variant
|
Returns the attribute which has been assigned to the given name |
RBXScriptSignal
|
Returns an event that fires when the given attribute changes |
Dictionary
|
Returns a dictionary of string → variant pairs for each of the |
Objects
|
Returns an array containing all of the |
string
[NotBrowsable]
|
Returns a coded string of the |
Array
[CustomLuaState]
|
Returns an array containing all of the descendants of the instance |
string
|
Returns a string describing the |
RBXScriptSignal
|
Get an event that fires when a given property of an object changes. |
bool
[CustomLuaState]
|
Returns true if an |
bool
|
Returns true if an |
bool
|
Returns true if an |
void
[Deprecated]
|
Sets the object’s Parent to nil, and does the same for all its descendants. |
void
|
Sets the attribute with the given name to the given value |
Instance
[CustomLuaState]
[CanYield]
|
Returns the child of the |
Objects
[Deprecated]
|
Returns an array of the object’s children. |
Instance
[Deprecated]
|
void
[Deprecated]
|
Instance
[Deprecated]
|
Objects
[Deprecated]
|
bool
[Deprecated]
[CustomLuaState]
|
bool
[Deprecated]
|
void
[Deprecated]
|
Events
Inherited from GuiObject: Show
RBXScriptSignal
[Deprecated]
|
Fired when a player begins dragging the object |
RBXScriptSignal
[Deprecated]
|
Fired when a player stops dragging the object |
RBXScriptSignal
|
Fired when a user begins interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc) |
RBXScriptSignal
|
Fired when a user changes how they’re interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc) |
RBXScriptSignal
|
Fired when a user stops interacting via a Human-Computer Interface device (Mouse button down, touch begin, keyboard button down, etc) |
RBXScriptSignal
|
Fires when a user moves their mouse into a GUI element |
RBXScriptSignal
|
Fires when a user moves their mouse out of a GUI element |
RBXScriptSignal
|
Fires whenever a user moves their mouse while it is inside a GUI element |
RBXScriptSignal
|
Fires when a user scrolls their mouse wheel back when the mouse is over a GUI element |
RBXScriptSignal
|
Fires when a user scrolls their mouse wheel forward when the mouse is over a GUI element |
RBXScriptSignal
|
Fired when the GuiObject is being focused on with the Gamepad selector |
RBXScriptSignal
|
Fired when the Gamepad selector stops focusing on the GuiObject |
RBXScriptSignal
|
Fires when the player starts, continues and stops long-pressing the UI element |
RBXScriptSignal
|
Fires when the player moves their finger on the UI element |
RBXScriptSignal
|
Fires when the player performs a pinch or pull gesture using two fingers on the UI element |
RBXScriptSignal
|
Fires when the player performs a rotation gesture using two fingers on the UI element |
RBXScriptSignal
|
Fires when the player performs a swipe gesture on the UI element |
RBXScriptSignal
|
Fires when the player performs a tap gesture on the UI element |
RBXScriptSignal
|
Fires when the |
RBXScriptSignal
|
Fires whenever an attribute is changed on the |
RBXScriptSignal
|
Fired immediately after a property of an object changes. |
RBXScriptSignal
|
Fires when an object is parented to this |
RBXScriptSignal
|
Fires when a child is removed from this |
RBXScriptSignal
|
Fires when a descendant is added to the |
RBXScriptSignal
|
Fires immediately before a descendant of the |
RBXScriptSignal
[Deprecated]
|
Code Samples
Image Animation using Spritesheet
This code sample uses ImageRectOffset/ImageRectSize in order to play an animation of a man throwing a punch
-- Place this in an ImageLabel/ImageButton with size 256x256
local imageLabel = script.Parent
-- The following image is 1024x1024 with 12 frames (256x256)
-- The frames play an animation of a man throwing a punch
imageLabel.Image = "rbxassetid://848623155"
imageLabel.ImageRectSize = Vector2.new(256, 256)
-- The order of the frames to be displayed (left-to-right, then top-to-bottom)
local frames = {
Vector2.new(0, 0); Vector2.new(1, 0); Vector2.new(2, 0); Vector2.new(3, 0);
Vector2.new(0, 1); Vector2.new(1, 1); Vector2.new(2, 1); Vector2.new(3, 1);
Vector2.new(0, 2); Vector2.new(1, 2); Vector2.new(2, 2); Vector2.new(3, 2);
}
-- Animate the frames one at a time in a loop
while true do
for i = 1, #frames do
imageLabel.ImageRectOffset = frames[i] * imageLabel.ImageRectSize
wait(.1)
end
end