LogoObsidian

Image

Images display static assets with optional tinting and sizing controls.

Playground

Image Unavailable

Usage

You can create an Image by calling the AddImage method on a Groupbox.

Arguments

Groupbox:AddImage("MyImage", {
    Image = "http://www.roblox.com/asset/?id=135666356081915",
    Height = 200,
})
Arg IdxArgument DescriptionTypeDefault
1Index/ID of the image elementstringnil
2Image configuration tabletablenil

Configuration Table

Prop

Type

Methods

You can use the following methods to interact with the image element:

SetImage

Updates the displayed image.

Image:SetImage(image)
Arg IdxArgument DescriptionTypeDefault
1Image URL or asset IDstringnil

SetTransparency

Sets the transparency value.

Image:SetTransparency(value)
Arg IdxArgument DescriptionTypeDefault
1Transparency between 0 and 1numbernil

SetColor

Applies a color tint.

Image:SetColor(color)
Arg IdxArgument DescriptionTypeDefault
1Color tint (Color3)Color3nil

SetRectOffset

Updates the rectangle offset.

Image:SetRectOffset(offset)
Arg IdxArgument DescriptionTypeDefault
1Offset (Vector2)Vector2nil

SetRectSize

Updates the rectangle size.

Image:SetRectSize(size)
Arg IdxArgument DescriptionTypeDefault
1Size (Vector2)Vector2nil

SetScaleType

Sets the frame scaling behaviour.

Image:SetScaleType(scaleType)
Arg IdxArgument DescriptionTypeDefault
1Scale type (Enum.ScaleType)Enum.ScaleTypenil

SetHeight

Adjusts the frame height.

Image:SetHeight(height)
Arg IdxArgument DescriptionTypeDefault
1Frame height in pixelsnumbernil

Example

local Options = Library.Options
 
local Image = Groupbox:AddImage("MyAgaImage", {
    Image = "http://www.roblox.com/asset/?id=135666356081915",
    Transparency = 0,
    Color = Color3.new(1, 1, 1),
    RectOffset = Vector2.zero,
    RectSize = Vector2.zero,
    ScaleType = Enum.ScaleType.Fit,
    Height = 200,
})
 
Image:SetImage(getcustomasset("mspaint.png"))
Image:SetTransparency(0.1)
Image:SetColor(Color3.fromRGB(255, 200, 200))

On this page