FocusUI
Dims the whole screen except one GuiObject, and optionally waits for it to be clicked.
This is the workhorse of most tutorials: show the player exactly one thing they can press, and move on when they press it.
Step.new(2, {
FocusUI.to(shopButton, { Advance = true }),
})
The dim panels live in a CanvasGroup, which is what keeps the four of them from stacking their
alpha and drawing a seam along the edge of the hole.
Functions
to
constructorTypes
interface FocusUIOptions {Advance: boolean?--
Move to the next step on click
}Highlights a GuiObject.
Just showing something
With no options it dims and waits. Some other action in the step has to end it.
FocusUI.to(inventoryPanel, { Padding = Vector2.new(12, 12) })
Advancing on click
FocusUI.to(shopButton, { Advance = true })
Deciding for yourself
Clicked receives the ActionContext, so the step can end on a condition:
FocusUI.to(buyButton, {
Clicked = function(context)
if playerHasEnoughCoins() then
context:Advance()
end
end,
})
How the click is detected
Three fallbacks, in order: the target itself if it is a GuiButton, otherwise the first
descendant button, otherwise raw InputBegan on the frame. That last one is what makes this
work on plain Frame targets, and it covers mouse and touch.