BillboardGui
A container for GuiObjects that renders in 3D space facing the camera.
Memory category | Instances |
---|
Member index 19
Removed member index 1
History | Member | |
---|---|---|
310 | Enabled: bool |
Description
BillboardGuis are containers for GuiObjects that appear in the 3D space. BillboardGuis always face the camera, and can either change size with distance or remain the same size on the screen based on the BillboardGui.Size property.
Their position is relative to the BillboardGui.Adornee. If no Adornee is set, then the parent of the BillboardGui will be used as the adornee. For BaseParts, the Position property will be used. For Attachments, the WorldPosition property will be used.
The Size property of a BillboardGui works slightly differently than GuiObject.Size. The Offset portion works the same, but the Scale portion is used as a size in studs in 3D space.
A size of UDim2.fromScale(4, 5)
is 4x5 studs, and scales the UI larger and
smaller depending on distance from the camera. A size of
UDim2.fromOffset(200, 100)
is always 200x100 on the screen, and does not
change size with distance. Scale and Offset values can also be combined
together, like with GuiObject.Size.
When creating size-scaled BillboardGuis, it's important to make sure all the UI objects within are using Scale sizing and all text has TextLabel.TextScaled enabled, to ensure correct scaling.
The AbsolutePosition property of a BillboardGui and all of its descendants is
relative to the top left corner of its canvas, and so is always 0, 0
for the
BillboardGui instance.
Caching Static UI for Performance
A Gui's appearance is cached until one of the following events occurs:
- A descendant is added to the Gui.
- A descendant is removed from the Gui.
- A property of a descendant of the Gui changes.
- A property of the Gui changes.
If any of these events occur, the Gui's appearance will be recomputed the next frame it gets rendered.
History 83
- 553 Change Default of StudsOffsetWorldSpace from to Vector3(0, 0, 0)
- 553 Change Default of StudsOffset from to Vector3(0, 0, 0)
- 553 Change Default of SizeOffset from to Vector2(0, 0)
- 553 Change Default of Size from to UDim2({0, 0}, {0, 0})
- 553 Change Default of PlayerToHideFrom from to
- 553 Change Default of MaxDistance from to INF
- 553 Change Default of LightInfluence from to 0
- 553 Change Default of ExtentsOffsetWorldSpace from to Vector3(0, 0, 0)
- 553 Change Default of ExtentsOffset from to Vector3(0, 0, 0)
- 553 Change Default of DistanceUpperLimit from to -1
- 553 Change Default of DistanceStep from to 0
- 553 Change Default of DistanceLowerLimit from to 0
- 553 Change Default of CurrentDistance from to 0
- 553 Change Default of ClipsDescendants from to false
- 553 Change Default of Brightness from to 1
- 553 Change Default of AlwaysOnTop from to false
- 553 Change Default of Adornee from to
- 553 Change Default of Active from to false
- 490 Add GetScreenSpaceBounds
- 486 Change ThreadSafety of StudsOffsetWorldSpace from ReadOnly to ReadSafe
- 486 Change ThreadSafety of StudsOffset from ReadOnly to ReadSafe
- 486 Change ThreadSafety of SizeOffset from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Size from ReadOnly to ReadSafe
- 486 Change ThreadSafety of PlayerToHideFrom from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxDistance from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LightInfluence from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ExtentsOffsetWorldSpace from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ExtentsOffset from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DistanceUpperLimit from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DistanceStep from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DistanceLowerLimit from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CurrentDistance from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ClipsDescendants from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Brightness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AlwaysOnTop from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Adornee from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Active from ReadOnly to ReadSafe
- 481 Change Category of Brightness from Appearance to Data
- 480 Add Brightness
- 462 Change ThreadSafety of StudsOffsetWorldSpace from to ReadOnly
- 462 Change ThreadSafety of StudsOffset from to ReadOnly
- 462 Change ThreadSafety of SizeOffset from to ReadOnly
- 462 Change ThreadSafety of Size from to ReadOnly
- 462 Change ThreadSafety of PlayerToHideFrom from to ReadOnly
- 462 Change ThreadSafety of MaxDistance from to ReadOnly
- 462 Change ThreadSafety of LightInfluence from to ReadOnly
- 462 Change ThreadSafety of ExtentsOffsetWorldSpace from to ReadOnly
- 462 Change ThreadSafety of ExtentsOffset from to ReadOnly
- 462 Change ThreadSafety of DistanceUpperLimit from to ReadOnly
- 462 Change ThreadSafety of DistanceStep from to ReadOnly
- 462 Change ThreadSafety of DistanceLowerLimit from to ReadOnly
- 462 Change ThreadSafety of CurrentDistance from to ReadOnly
- 462 Change ThreadSafety of ClipsDescendants from to ReadOnly
- 462 Change ThreadSafety of AlwaysOnTop from to ReadOnly
- 462 Change ThreadSafety of Adornee from to ReadOnly
- 462 Change ThreadSafety of Active from to ReadOnly
- 382 Add DistanceUpperLimit
- 382 Add DistanceStep
- 382 Add DistanceLowerLimit
- 382 Add CurrentDistance
- 340 Add ClipsDescendants
- 329 Change ValueType of PlayerToHideFrom from Object to Instance
- 329 Change ValueType of Adornee from Object to Instance
- 310 Remove Enabled
- 295 Add MaxDistance
- 291 Add LightInfluence
- 281 Add StudsOffsetWorldSpace
- 281 Add ExtentsOffsetWorldSpace
- 257 Add Enabled
- 258 Remove Enabled
- 87 Change Superclass of BillboardGui from GuiBase2d to LayerCollector
- 85 Change Superclass of BillboardGui from GuiBase to GuiBase2d
- 55 Change Tags of BillboardGui from [preliminary] to []
- 50 Add PlayerToHideFrom
- 47 Add StudsOffset
- 47 Add SizeOffset
- 47 Add Size
- 47 Add ExtentsOffset
- 47 Add Enabled
- 47 Add AlwaysOnTop
- 47 Add Adornee
- 47 Add Active
- 47 Add BillboardGui
Members 19
Active
Type | Default | |
---|---|---|
bool | false |
Controls whether the descendants will receive input events. If the UI contains a GuiButton then that button will become clickable only if Active is set to true on both the BillboardGui and the button.
BillboardGuis will only receive user input if they are parented to the PlayerGui. The BillboardGui.Adornee property can be used to target a Part in the workspace while the UI itself is in the PlayerGui.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
Adornee
Type | Default | |
---|---|---|
Instance |
Sets the target part or attachment that the BillboardGui is positioned relative to. If no Adornee is set, then the Parent is used instead.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
AlwaysOnTop
Type | Default | |
---|---|---|
bool | false |
Determines whether the BillboardGui will render over top of 3D content, or be occluded by it.
When set to false, the BillboardGui will render like other 3D content, and will be occluded by other 3D objects.
When set to true, it always renders on top of 3D content, and the appearance changes significantly:
- Colors match how they appear inside a ScreenGui.
- Text may appear sharper on high DPI devices.
- BillboardGui.LightInfluence is treated as though it was 0.
- BillboardGui.Brightness has no effect.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of AlwaysOnTop from to false
- 486 Change ThreadSafety of AlwaysOnTop from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AlwaysOnTop from to ReadOnly
- 47 Add AlwaysOnTop
Brightness
Type | Default | |
---|---|---|
float | 1 |
Brightness determines the factor by which the GUI's emitted light is scaled. By default, this property is 1 and can be set to any number on the range [0, 1000].
By modifying this property, the apparent brightness of a GUI can be better matched to its environment. For instance, a video billboard like those found in Times Square can be made brighter to be clearly visible on a bright day.
This property won't produce any effect in the following scenarios wherein the GUI does not emit light.:
- When AlwaysOnTop is true, the color of each pixel is the color shown on-screen.
- When LightInfluence is 1, all light from the GUI is reflected from the environment instead of being emit.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of Brightness from to 1
- 486 Change ThreadSafety of Brightness from ReadOnly to ReadSafe
- 481 Change Category of Brightness from Appearance to Data
- 480 Add Brightness
ClipsDescendants
Type | Default | |
---|---|---|
bool | false |
When set to true, portions of GuiObjects that fall outside of the BillboardGui's canvas borders will not be drawn.
Even when this property is false, objects that are completely outside of the canvas of the BillboardGui will not render.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | true |
History 4
- 553 Change Default of ClipsDescendants from to false
- 486 Change ThreadSafety of ClipsDescendants from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ClipsDescendants from to ReadOnly
- 340 Add ClipsDescendants
CurrentDistance
Type | Default | |
---|---|---|
float | 0 |
The current distance in studs that the BillboardGui is from the player's camera. A changed event does not fire for this property unless the gui's BillboardGui.DistanceStep is more than 0.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of CurrentDistance from to 0
- 486 Change ThreadSafety of CurrentDistance from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CurrentDistance from to ReadOnly
- 382 Add CurrentDistance
DistanceLowerLimit
Type | Default | |
---|---|---|
float | 0 |
Determines the distance in studs that a BillboardGui will stop scaling larger in size at relative to the player's current camera. If the distance of the gui is below this value, it will not be scaled any larger than it would be at this distance. The value of this property defaults to 0 studs.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of DistanceLowerLimit from to 0
- 486 Change ThreadSafety of DistanceLowerLimit from ReadOnly to ReadSafe
- 462 Change ThreadSafety of DistanceLowerLimit from to ReadOnly
- 382 Add DistanceLowerLimit
DistanceStep
Type | Default | |
---|---|---|
float | 0 |
Determines the size BillboardGui.CurrentDistance increments and decrements in studs as the player's camera moves closer and further from the BillboardGui. The property defaults to 0 and rounds up starting from BillboardGui.DistanceLowerLimit.
For example, if this property is set to 0.5 and the player's camera is moving away from the gui starting from 0 then CurrentDistance will increase 0 -> 0.5 -> 1 -> 1.5 -> ... and so forth.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of DistanceStep from to 0
- 486 Change ThreadSafety of DistanceStep from ReadOnly to ReadSafe
- 462 Change ThreadSafety of DistanceStep from to ReadOnly
- 382 Add DistanceStep
DistanceUpperLimit
Type | Default | |
---|---|---|
float | -1 |
Determines the distance in studs that a BillboardGui will stop scaling smaller in size at relative to the player's current camera. If the distance of the gui is above this value, it will not be scaled any smaller than it would be at this distance.
This property is ignored if the value is less than 0. The default value is -1, meaning the property is ignored by default.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of DistanceUpperLimit from to -1
- 486 Change ThreadSafety of DistanceUpperLimit from ReadOnly to ReadSafe
- 462 Change ThreadSafety of DistanceUpperLimit from to ReadOnly
- 382 Add DistanceUpperLimit
ExtentsOffset
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
ExtentsOffset determines how the BillboardGui is offset from its Adornee, relative to the Camera orientation and units are half the dimensions of the model's Camera-aligned bounding box.
See also:
- ExtentsOffsetWorldSpace, which works similarly except the offset orientation is relative to the global axes
- StudsOffset, which works similarly except the units are studs
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ExtentsOffset from to Vector3(0, 0, 0)
- 486 Change ThreadSafety of ExtentsOffset from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ExtentsOffset from to ReadOnly
- 47 Add ExtentsOffset
ExtentsOffsetWorldSpace
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
ExtentsOffsetWorldSpace determines how the BillboardGui is offset from its Adornee, relative to the global axes and units are half the dimensions of the model's axis-aligned bounding box.
See also:
- ExtentsOffset, which works similarly except the offset orientation is relative to the Camera
- StudsOffsetWorldSpace, which works similarly except the units are studs
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of ExtentsOffsetWorldSpace from to Vector3(0, 0, 0)
- 486 Change ThreadSafety of ExtentsOffsetWorldSpace from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ExtentsOffsetWorldSpace from to ReadOnly
- 281 Add ExtentsOffsetWorldSpace
GetScreenSpaceBounds
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Variant |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
LightInfluence
Type | Default | |
---|---|---|
float | 0 |
Controls how much the BillboardGui is influenced by the lighting in the environment.
When set to 0, the UI behaves similarly to an LCD screen, acting as its own light source and appearing the same regardless of the surrounding lighting.
When set to 1, the UI behaves similarly to a piece of paper, only reflecting the light from another source.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of LightInfluence from to 0
- 486 Change ThreadSafety of LightInfluence from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LightInfluence from to ReadOnly
- 291 Add LightInfluence
MaxDistance
Type | Default | |
---|---|---|
float | INF |
The MaxDistance property of a BillboardGui sets how far away in studs that billboard can be from the camera and still be drawn. If the camera and billboard are moved further apart than the maximum distance, then the billboard will not be visible regardless of any other properties of the billboard or any GUI objects it contains. The default value of this property is infinity
If this value is set to less than or equal to 0 then the maximum distance will be treated as infinite and the billboard will always be drawable.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of MaxDistance from to INF
- 486 Change ThreadSafety of MaxDistance from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MaxDistance from to ReadOnly
- 295 Add MaxDistance
PlayerToHideFrom
Type | Default | |
---|---|---|
Instance |
Used by scripts to hide the BillboardGui from a specific player.
To hide the UI from more than one player, place the BillboardGui into StarterGui and use a script to set the BillboardGui.Enabled property according to whether the Players.LocalPlayer should be able to see it. The BillboardGui.Adornee property can be used to attach the BillboardGui to a Part or Attachment in the Workspace, instead of parenting it.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 5
- 553 Change Default of PlayerToHideFrom from to
- 486 Change ThreadSafety of PlayerToHideFrom from ReadOnly to ReadSafe
- 462 Change ThreadSafety of PlayerToHideFrom from to ReadOnly
- 329 Change ValueType of PlayerToHideFrom from Object to Instance
- 50 Add PlayerToHideFrom
Size
Type | Default | |
---|---|---|
UDim2 | {0, 0}, {0, 0} |
Controls the size that the BillboardGui will have on screen.
The Scale component of the Size is interpreted as a size in studs, and the UI will automatically scale with distance if Scale values are used.
The Scale and Offset portions of the size are added together, and can be used at the same time.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
SizeOffset
Type | Default | |
---|---|---|
Vector2 | 0, 0 |
A 2D offset in size-relative units that acts like an anchor point. This can be used similarly to the GuiObject.AnchorPoint property, but the values are different.
Common Values
SizeOffset | Explanation |
---|---|
0.0, 0.0 | The default. The UI will be anchored at its center. |
0.5, 0.5 | The UI will anchor at the bottom left. |
0.5, -0.5 | The UI will anchor at the top left. |
-0.5, 0.5 | The UI will anchor at the top right. |
-0.5, -0.5 | The UI will anchor at the bottom right. |
See also:
- StudsOffset, StudsOffsetWorldSpace, ExtentsOffset, ExtentsOffsetWorldSpace, which are all other offset properties that work in 3D space instead
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of SizeOffset from to Vector2(0, 0)
- 486 Change ThreadSafety of SizeOffset from ReadOnly to ReadSafe
- 462 Change ThreadSafety of SizeOffset from to ReadOnly
- 47 Add SizeOffset
StudsOffset
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
StudsOffset determines how the BillboardGui is offset from its Adornee, relative to the Camera orientation with units in studs.
See also:
- StudsOffsetWorldSpace, which works similarly except the offset orientation is relative to the global axes
- ExtentsOffset, which works similarly except the units are half the dimensions of the model's Camera-aligned bounding box
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of StudsOffset from to Vector3(0, 0, 0)
- 486 Change ThreadSafety of StudsOffset from ReadOnly to ReadSafe
- 462 Change ThreadSafety of StudsOffset from to ReadOnly
- 47 Add StudsOffset
StudsOffsetWorldSpace
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
StudsOffsetWorldSpace determines how the BillboardGui is offset from its Adornee, relative to the global axes with units in studs.
See also:
- StudsOffset, which works similarly except the offset orientation is relative to the Camera
- ExtentsOffsetWorldSpace, which works similarly except the units are half the dimensions of the model's axis-aligned bounding box
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of StudsOffsetWorldSpace from to Vector3(0, 0, 0)
- 486 Change ThreadSafety of StudsOffsetWorldSpace from ReadOnly to ReadSafe
- 462 Change ThreadSafety of StudsOffsetWorldSpace from to ReadOnly
- 281 Add StudsOffsetWorldSpace