Adding an Image
Images inside a GUI are typically
ImageLabel objects, basic 2D images which can be resized as needed.
- Insert an ImageLabel into the ScoreBarFrame object and select it.
To place this tutorial’s crown image into the label, locate its Image property and paste in rbxassetid://5673786644.
Expand the image object’s Size tree and set the following property values:
As you can see, these scaling values stretch the image beyond the full width of the frame. To make sure that only the height is considered, change the image’s SizeConstraint to RelativeYY.
Elements in a
UIListLayoutare ordered by their LayoutOrder. Change this property to 1 since the image should be the first element inside the frame. You won’t see any change since the image is the only element, but it’s a good idea to set the layout order now.
Finally, change the image’s background from white to fully transparent by setting BackgroundTransparency to 1.
GUI text is often rendered through a
TextLabel object which lets you choose a font, color, alignment, and more.
- Insert a TextLabel into the ScoreBarFrame object and select it.
Change its LayoutOrder property to 2. Because the associated
UIListLayoutis set to horizontal, this will place the label to the right of the image.
Resize the label by setting the following property values:
Style the text by setting its font, color, and scaling.
Change TextXAlignment to Left so that the score text stays left-aligned near the crown image regardless of whether the player’s score is 0, 1000, or 1000000.
Finally, make the label’s background fully transparent by setting BackgroundTransparency to 1.
This covers the basics of GUI objects — you now have a basic score bar that adapts to both large and small screens.
Previous Page Getting Started