A callout / popover: a rounded panel with a directional tail pointing at an anchor point, shown on UIRoot.popupLayer. Add content to body (below the optional title). It prefers to sit below the anchor with the tail pointing up, flips above when it would clip the viewport bottom, and clamps horizontally while keeping the tail aimed at the anchor.

A transparent full-screen blocker sits behind it: a click outside closes it (as do Escape and the host's Back handling via UIRoot.pushOverlayCloser). Unlike UIModal it does not dim the background. Closing disposes the balloon.

Constructor

new(width:Float, height:Float, ?title:String)

Parameters:

width

the balloon width

height

the balloon height (tail excluded)

title

optional header text

Variables

finalbody:UIComponent

Add balloon content here (coordinates relative to the balloon, below the title).

@:value(null)titleText:String = null

Optional header text; null for a title-less balloon.

@:value(null)onClosed:() ‑> Void = null

Fired after the balloon fully closes.

Methods

close():Void

Closes the balloon (fade out, then dispose).

open(anchorX:Float, anchorY:Float):Void

Opens the balloon pointing at a UI-space anchor point.

Parameters:

anchorX

the anchor x in UI (root content) coordinates

anchorY

the anchor y in UI coordinates

openAt(target:DisplayObject):Void

Opens the balloon pointing at the bottom-center of a display object.

Parameters:

target

the object to point at (must be on the stage)

Inherited Variables

Defined by UIComponent

@:value(true)enabled:Bool = true

Disabled widgets ignore the pointer and typically render dimmed.

@:value(0)read onlyh:Float = 0

Layout height in UI units.

@:value(MouseCursor.BUTTON)hoverCursor:MouseCursor = MouseCursor.BUTTON

Native cursor while hovering (interactive widgets; null keeps the arrow).

@:value(false)read onlyhovered:Bool = false

true while the cursor is over this widget.

@:value(false)longPressable:Bool = false

Opts a subclass that overrides onRightPress (without setting onRightClick) into long-press-as-right-click on touch. Widgets with onRightClick set are included automatically.

@:value(null)onClick:() ‑> Void = null

Fired on a completed click (press + release on this widget). Requires an interactive widget.

@:value(null)onHover:() ‑> Void = null

Fired when the cursor first enters this widget (hover-driven descriptions/previews). Interactive widgets only.

@:value(null)onRightClick:() ‑> Void = null

Fired on a right mouse press over this widget (context menus). Only interactive widgets receive pointer events, so this never fires on passive widgets like UILabel/UIPanel — attach it to a UIButton (or another interactive widget) instead. On touch, a long-press fires the same path (see UIRoot.longPressMs).

@:value(false)read onlypressed:Bool = false

true while a press that started here is held.

@:value(null)tooltip:String = null

Optional tooltip text (already-localized or a fixed string).

@:value(null)tooltipShortcut:String = null

Optional right-aligned shortcut hint rendered in the tooltip.

@:value(0)read onlyw:Float = 0

Layout width in UI units (independent of DisplayObject's content-derived width).

Inherited Methods

Defined by UIComponent

invalidate():Void

Schedules a repaint for the next frame (cheap; deduplicated).

resize(width:Float, height:Float):Void

Sets the layout size and repaints when it changed.

Parameters:

width

the new layout width in UI units

height

the new layout height in UI units