UI Progress Bar
Shows a bar that fills up to track progress, for a countdown, a timer or a level. You choose the size, the colors and up to three checkpoint marks.
Game engines, physics, quizzes, leaderboards, and the UI controls that tie it together.
Made with this blockInputs
positionvec2Screen position of the progress bar, where (0, 0) is the top-left corner and (1, 1) is the bottom-right corner.
widthfloatWidth of the progress bar in screen anchor units. Range from 0 to 2, where 0 means no visible progress bar and 2 means the progress bar spans the full width of the screen (from the left border to the right).
heightfloatHeight of the progress bar in screen anchor units. The range is from 0 to 0.25, where 0 means no height at all (no visible progress bar) and 0.25 is the maximum height.
rotationfloatRotation in degrees, counterclockwise (0-360)
backgroundColorvec4Color of the background behind the bar
barColorvec4Bar color
roundnessfloatCorner roundness of bar and background (0-1), where 0 - square ends, no corner radius, 1 - fully rounded ends, pill-shaped
borderWidthfloatBorder thickness around the bar (0-1, where 1 = 1/8 screen height)
checkpointCountintNumber of visible checkpoints (0-3)
checkpointColorvec4Color of all checkpoint markers
checkpointPosition1floatNormalized position of checkpoint 1 (0-1)
checkpointPosition2floatNormalized position of checkpoint 2 (0-1)
checkpointPosition3floatNormalized position of checkpoint 3 (0-1)
Events
onCheckpoint1ReachedProgress crosses the leftmost active checkpoint (sorted by position)
onCheckpoint2ReachedProgress crosses the second-leftmost active checkpoint
onCheckpoint3ReachedProgress crosses the rightmost active checkpoint
onProgressBarFullProgress reaches 1 (from below)
onProgressBarEmptyProgress drops to 0 (from above)
Functions
setProgressvoidSets the bar fill amount (0-1)
getProgressfloatReturns the current progress value
More in Games & Interactivity
- JoystickAdds an on-screen joystick that you drag to move or steer something in the Lens. Choose where it sits, how big it is, and how it looks.
- LeaderboardSaves the scores from your Lens and shows them in a ranked list. You can compare with friends and with people around the world.
- Physics2DMakes 2D objects fall, collide and bounce off each other like real things. It draws nothing itself, so the Lens needs something else to show the objects.
- QuizRuns a quiz on the screen, with buttons or a tilt of your head to answer. Say what the quiz is about, for example American history or your personality type.
- Tic Tac ToeAdds tic tac toe on a 3D board, for one player against the Lens. Choose the look of the board and the two 3D pieces.
- Turn ManagerRuns a two player game that you send to a friend. You take a turn, then your friend opens the Lens and takes the next one.
- UI ButtonAdds a button you tap on screen. You choose the label, the color, the shape, pill or circle, and where it sits on the screen.
- UI SliderAdds a bar you drag to set a value, for example how strong an effect is. The bar is horizontal, and you choose its size and colors.
- Video Control UIPlays your videos full screen, one after another, with play, pause and a bar you can drag. You add up to five videos.
- What X Are You?Spins through options above your head and stops on one, for example a star sign or a persona. You give up to six options, as text, pictures or both.
