rojo/.cursor/rules/roblox/reference/engine/classes/ImageLabel.yaml
2026-02-02 12:08:47 -06:00

351 lines
11 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: ImageLabel
type: class
memory_category: Gui
summary: |
A 2D user interface element that displays a single non-interactive image.
description: |
An `Class.ImageLabel` renders a rectangle, like a `Class.Frame` does, with an
image asset. The display of the image can be manipulated through the
`Class.ImageLabel.ImageColor3|ImageColor3` and
`Class.ImageLabel.ImageTransparency|ImageTransparency` properties. To display
only the image and hide the rectangle, set
`Class.GuiObject.BackgroundTransparency` to `1`.
Advanced `Class.ImageLabel` usage includes:
- Tiled images can be created by setting
`Class.ImageLabel.ScaleType|ScaleType` to `Enum.ScaleType.Tile`, then
`Class.ImageLabel.TileSize|TileSize` to the size of rendered tiles.
- 9-slice images can be created by setting
`Class.ImageLabel.ScaleType|ScaleType` to `Enum.ScaleType.Slice`, then
`Class.ImageLabel.SliceCenter|SliceCenter` to the center area of the 9‑slice
image.
- Sprite sheets can be implemented through the use of
`Class.ImageLabel.ImageRectOffset|ImageRectOffset` and
`Class.ImageLabel.ImageRectSize|ImageRectSize`. Packing multiple images into
one and using this property can make your experience's image assets load
much quicker, especially if you use many small icons in your GUIs.
code_samples: []
inherits:
- GuiLabel
descendants: []
tags: []
deprecation_message: ''
properties:
- name: ImageLabel.Image
summary: |
The image content displayed by the UI element. Reads and writes to
`Class.ImageLabel.ImageContent|ImageContent`.
description: |
This property is a content-type property that should hold the asset ID of
a decal or image uploaded to Roblox. It functions identically to
`Class.Decal.Texture` with regards to loading the image from Roblox. The
rendered image can be modified using
`Class.ImageLabel.ImageColor3|ImageColor3` and
`Class.ImageLabel.ImageTransparency|ImageTransparency`.
code_samples: []
type: ContentId
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ImageColor3
summary: |
Determines how a rendered image will be colorized.
description: |
This property determines how an image is colorized. When set to white, no
colorization occurs. This property is very useful for reusing image
assets; if the source image is completely white with transparency, you can
set the entire color of the image at once with this property.
code_samples: []
type: Color3
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ImageContent
summary: |
The image content displayed by the UI element. Supports
[asset URIs](../../../projects/assets/index.md#asset-uris) and
`Class.EditableImage` objects.
description: |
This property should hold an
[asset URI](../../../projects/assets/index.md#asset-uris) or a reference
to an `Class.EditableImage` object.
The asset URI can reference a decal or image uploaded to Roblox. It
functions identically to `Class.Decal.Texture` with regards to loading the
image.
The rendered image will be colorized using
`Class.ImageButton.ImageColor3`. It is possible to make the image render
as tiled, scaled to fit, or 9-sliced, by adjusting the
`Class.ImageButton.ScaleType` property.
code_samples: []
type: Content
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ImageRectOffset
summary: |
The offset in pixels of the sub-area of an image to be displayed.
description: |
Allows the partial display of an image in conjunction with
`Class.ImageLabel.ImageRectSize|ImageRectSize`. This property determines
the pixel offset (from the top-left) of the image area to be displayed.
code_samples: []
type: Vector2
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ImageRectSize
summary: |
Determines the size in pixels of the sub-area of an image to be displayed.
description: |
Allows the partial display of an image in conjunction with
`Class.ImageLabel.ImageRectOffset|ImageRectOffset`. This property
determines the pixel size of the image area to be displayed. If either
dimension is set to `0`, the entire image is displayed instead.
code_samples: []
type: Vector2
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ImageTransparency
summary: |
Determines the transparency of the rendered image.
description: |
This property determines the alpha of a UI element's rendered image. A
value of `0` is completely opaque and a value of `1` is completely
transparent (invisible).
code_samples:
- Oscillate-ImageTransparency
type: float
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.IsLoaded
summary: |
Indicates whether the image has finished loading from Roblox.
description: |
This property indicates if the `Class.ImageLabel.Image` property has
finished loading from Roblox. Images declined by moderation will never
load.
code_samples:
- Image-Load-Time
type: boolean
tags:
- ReadOnly
- NotReplicated
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: false
can_save: false
capabilities:
- UI
- name: ImageLabel.ResampleMode
summary: |
Selects the image resampling mode for the label.
description: |
Determines how the image looks when it is scaled. By default, the image
smooths out texturing when displayed on the screen larger or smaller than
its size in texture memory. When set to
`Enum.ResamplerMode.Pixelated|Enum.ResamplerMode.Pixelated`, the image
preserves the sharp edges of pixels.
code_samples: []
type: ResamplerMode
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.ScaleType
summary: |
Determines how an image will scale if displayed in a UI element whose size
differs from the source image.
description: |
This property determines in what way an `Class.ImageLabel.Image` is
rendered when the UI element's absolute size differs from the source
image's size.
By default, this property is `Enum.ScaleType.Stretch` which will simply
stretch/compact the image dimensions so it fits the UI element's space
exactly. Since transparent pixels are set to black when uploading to
Roblox, transparent images should apply alpha blending to avoid a blackish
outline around scaled images.
For `Enum.ScaleType.Slice`, the `Class.ImageLabel.SliceCenter|SliceCenter`
property will be revealed in the
[Properties](../../../studio/properties.md) window. This is for nine-slice
UI: when scaling up, the corners will remain the source image size. The
edges of the image will stretch to the width/height of the image. Finally,
the center of the image will stretch to fill the center area of the image.
Finally, for `Enum.ScaleType.Tile`, the
`Class.ImageLabel.TileSize|TileSize` property will be revealed in the
[Properties](../../../studio/properties.md) window. This is for tiled
images, where the size of each image tile is determined by the
`Class.ImageLabel.TileSize|TileSize` property.
code_samples: []
type: ScaleType
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.SliceCenter
summary: |
Sets the slice boundaries of a 9-sliced image.
description: |
This property sets the slice boundaries of a 9-sliced image when
`Class.ImageLabel.ScaleType|ScaleType` is set to
`Enum.ScaleType.Slice|Enum.ScaleType.Slice`. Please note that this
property is only visible in the
[Properties](../../../studio/properties.md) window under this condition.
To learn more about 9-slice images, see
[UI 9 Slice Design](../../../ui/9-slice.md).
code_samples: []
type: Rect
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.SliceScale
summary: |
Scales the 9-slice edges by the specified ratio.
description: |
Scales the 9-slice edges by the specified ratio. This means that the edges
around the 9-slice will grow as if you'd uploaded a new version of the
texture upscaled. Defaults to `1.0`.
See also `Class.ImageLabel.ScaleType|ScaleType`,
`Class.ImageLabel.SliceCenter|SliceCenter`, and
`Class.ImageLabel.SliceScale|SliceScale`.
code_samples: []
type: float
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
- name: ImageLabel.TileSize
summary: |
Sets the tiling size of the `Class.ImageLabel`.
description: |
This property sets the tiling size of the `Class.ImageLabel` with a
default of
<Typography noWrap>`Datatype.UDim2.new(1, 0, 1, 0)`</Typography>. Tiling
starts at the top-left corner of the image. This property is only active
if the `Class.ImageLabel.ScaleType|ScaleType` for the `Class.ImageLabel`
is set to `Enum.ScaleType.Tile`.
code_samples:
- Image-ScaleType-Demo
type: UDim2
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Image
serialization:
can_load: true
can_save: true
capabilities:
- UI
methods: []
events: []
callbacks: []