Skip to main content

Image

Image Widget API

Provides two widgets for Images and ImageButtons, which provide the same control as a an ImageLabel instance.

Properties

Image

Widget
Image.Image: Iris.Image

An image widget for displaying an image given its texture ID and a size. The widget also supports Rect Offset and Size allowing cropping of the image and the rest of the ScaleType properties. Some of the arguments are only used depending on the ScaleType property, such as TileSize or Slice which will be ignored.

hasChildren = false
hasState = false
Arguments = {
    Image: string, -- the texture asset id
    Size: UDim2,
    Rect: Rect? = Rect.new(), -- Rect structure which is used to determine the offset or size. An empty, zeroed rect is equivalent to nil
    ScaleType: Enum.ScaleType? = Enum.ScaleType.Stretch, -- used to determine whether the TileSize, SliceCenter and SliceScale arguments are used
    ResampleMode: Enum.ResampleMode? = Enum.ResampleMode.Default,
    TileSize: UDim2? = UDim2.fromScale(1, 1), -- only used if the ScaleType is set to Tile
    SliceCenter: Rect? = Rect.new(), -- only used if the ScaleType is set to Slice
    SliceScale: number? = 1 -- only used if the ScaleType is set to Slice
}
Events = {
    hovered: () -> boolean
}

ImageButton

Widget
Image.ImageButton: Iris.ImageButton

An image button widget for a button as an image given its texture ID and a size. The widget also supports Rect Offset and Size allowing cropping of the image, and the rest of the ScaleType properties. Supports all of the events of a regular button.

hasChildren = false
hasState = false
Arguments = {
    Image: string, -- the texture asset id
    Size: UDim2,
    Rect: Rect? = Rect.new(), -- Rect structure which is used to determine the offset or size. An empty, zeroed rect is equivalent to nil
    ScaleType: Enum.ScaleType? = Enum.ScaleType.Stretch, -- used to determine whether the TileSize, SliceCenter and SliceScale arguments are used
    ResampleMode: Enum.ResampleMode? = Enum.ResampleMode.Default,
    TileSize: UDim2? = UDim2.fromScale(1, 1), -- only used if the ScaleType is set to Tile
    SliceCenter: Rect? = Rect.new(), -- only used if the ScaleType is set to Slice
    SliceScale: number? = 1 -- only used if the ScaleType is set to Slice
}
Events = {
    clicked: () -> boolean,
    rightClicked: () -> boolean,
    doubleClicked: () -> boolean,
    ctrlClicked: () -> boolean, -- when the control key is down and clicked.
    hovered: () -> boolean
}
Show raw api
{
    "functions": [],
    "properties": [
        {
            "name": "Image",
            "desc": "An image widget for displaying an image given its texture ID and a size. The widget also supports Rect Offset and Size allowing cropping of the image and the rest of the ScaleType properties.\nSome of the arguments are only used depending on the ScaleType property, such as TileSize or Slice which will be ignored.\n\n```lua\nhasChildren = false\nhasState = false\nArguments = {\n    Image: string, -- the texture asset id\n    Size: UDim2,\n    Rect: Rect? = Rect.new(), -- Rect structure which is used to determine the offset or size. An empty, zeroed rect is equivalent to nil\n    ScaleType: Enum.ScaleType? = Enum.ScaleType.Stretch, -- used to determine whether the TileSize, SliceCenter and SliceScale arguments are used\n    ResampleMode: Enum.ResampleMode? = Enum.ResampleMode.Default,\n    TileSize: UDim2? = UDim2.fromScale(1, 1), -- only used if the ScaleType is set to Tile\n    SliceCenter: Rect? = Rect.new(), -- only used if the ScaleType is set to Slice\n    SliceScale: number? = 1 -- only used if the ScaleType is set to Slice\n}\nEvents = {\n    hovered: () -> boolean\n}\n```\n    ",
            "lua_type": "Iris.Image",
            "tags": [
                "Widget"
            ],
            "source": {
                "line": 598,
                "path": "lib/API.lua"
            }
        },
        {
            "name": "ImageButton",
            "desc": "An image button widget for a button as an image given its texture ID and a size. The widget also supports Rect Offset and Size allowing cropping of the image, and the rest of the ScaleType properties.\nSupports all of the events of a regular button.\n\n```lua\nhasChildren = false\nhasState = false\nArguments = {\n    Image: string, -- the texture asset id\n    Size: UDim2,\n    Rect: Rect? = Rect.new(), -- Rect structure which is used to determine the offset or size. An empty, zeroed rect is equivalent to nil\n    ScaleType: Enum.ScaleType? = Enum.ScaleType.Stretch, -- used to determine whether the TileSize, SliceCenter and SliceScale arguments are used\n    ResampleMode: Enum.ResampleMode? = Enum.ResampleMode.Default,\n    TileSize: UDim2? = UDim2.fromScale(1, 1), -- only used if the ScaleType is set to Tile\n    SliceCenter: Rect? = Rect.new(), -- only used if the ScaleType is set to Slice\n    SliceScale: number? = 1 -- only used if the ScaleType is set to Slice\n}\nEvents = {\n    clicked: () -> boolean,\n    rightClicked: () -> boolean,\n    doubleClicked: () -> boolean,\n    ctrlClicked: () -> boolean, -- when the control key is down and clicked.\n    hovered: () -> boolean\n}\n```\n    ",
            "lua_type": "Iris.ImageButton",
            "tags": [
                "Widget"
            ],
            "source": {
                "line": 630,
                "path": "lib/API.lua"
            }
        }
    ],
    "types": [],
    "name": "Image",
    "desc": "Image Widget API\n\nProvides two widgets for Images and ImageButtons, which provide the same control as a an ImageLabel instance.\n    ",
    "source": {
        "line": 571,
        "path": "lib/API.lua"
    }
}