Fox has two popup helpers — pick the one that matches your need:
components/popup.gd— the full-featured popup base: aReferenceRectwith automatic blur, a panel show/hide animation, and a close button. Use it for in-game dialogs (shop, confirm, review…). Documented below.FoxPopup(core/popup.gd) — a minimalControlbase that only adds a layout refresh (_onViewportResized) on window resize. Use it for custom overlays that manage their own visuals. See screens & responsive. The refresh re-runs the popup's own layout; the global scale factor itself is re-posed by the game's entry point, not by the popup — see the responsive helper.
Create a ReferenceRect extending components/popup:
extends 'res://fox/components/popup.gd'If you override _ready, call super._ready():
func _ready():
super._ready()Instantiate it somewhere, typically in your Router, adding it under the
popups node:
var ShopPopup = preload('res://shop.tscn')
func openShop():
var shop = ShopPopup.instantiate()
$/root/app/popups.add_child(shop)The base wires up child nodes by name automatically:
- a
components/blur.tscnnamedblur→ blurred background, shown/hidden with the popup; - a
Panelnamedpanel→ its content is faded in/out automatically; - a
closeButton(inside the panel) with apressedsignal → callsclose()automatically.
Exports / flags:
blurAmount: int = 60— target blur strengththisPopupPauseEngine— settrueto pause the tree while the popup is openclosedsignal — emitted on close
extends 'res://fox/components/popup.gd'
func _ready():
super._ready()
Animate.from(panel, {
propertyPath = 'position',
fromValue = panel.position + Vector2(0, G.H),
duration = 1,
transition = Tween.TRANS_QUAD,
easing = Tween.EASE_OUT
})
func close():
Router.openHome()