class TooltipOverlay
package flixel.system.debug
extends Sprite › DisplayObjectContainer › InteractiveObject › DisplayObject › EventDispatcher
import flixel.system.debug.Tooltip
A generic, Flash-based tooltip class, created for use in FlxDebugger.
Constructor
new(target:Sprite, text:String, width:Float = 0, height:Float = 0)
Creates a new tooltip.
Parameters:
target | Element the tooltip will monitor. If the tooltip is being used in "stand alone" fashion, i.e. not monitoring any element, then use |
---|---|
text | Text displayed with this tooltip. |
width | Width of the tooltip. If a negative value (or zero) is specified, the tooltip will adjust its width to properly accommodate the text. |
height | Height of the tooltip. If a negative value (or zero) is specified, the tooltip will adjust its height to properly accommodate the text. |
Variables
maxSize:Point
Maximum size allowed for the tooltip. A negative value (or zero) makes the tooltip auto-adjust its size to properly house its text.
read onlytextField:TextField
Texfield used by the tooltip to display text. If you change anything in the textfield,
be sure to call the proper methods of the tooltip to ensure it keeps a correct size, etc.
If you just want to change the text of the tooltip, use the method setText()
instead, since
it takes care of properly resizing and positioning the tooltip after the text changes.
Methods
reposition(X:Float, Y:Float):Void
Change the position of the tooltip.
Parameters:
X | Desired X position of top left corner of the tooltip. |
---|---|
Y | Desired Y position of top left corner of the tooltip. |
resize(Width:Float, Height:Float):Void
Resize the tooltip. Subject to pre-specified minimums, maximums, and bounding rectangles.
Parameters:
Width | How wide to make the tooltip. If zero is specified, the tooltip will adjust its size to properly accommodate the text. |
---|---|
Height | How tall to make the tooltip. If zero is specified, the tooltip will adjust its size to properly accommodate the text. |