InfoBox

Methods
16
Fields
None

Getting one

InfoBox.new(…)

Methods

MethodReturnsDescription
getText()string?The caption. Abstract: a subclass defines it.
getTextColor()Color?The caption's colour (nil: white). Abstract: a subclass defines it.
render()booleanWhether to show the box this frame: true; override it. Anything but true hides it.
cull()booleanWhether to remove the box (asked once a game tick): false; override it.
getName()stringThe key its detached group is saved under: <plugin>_<class> (see the class doc). Override it to choose another.
getPlugin()PluginObject?The plugin it was made with: the manager orders a priority's boxes by its name.
getImage()BufferedImage?The image.
setImage(BufferedImage?)()Sets the image; once added, infoBoxManager:updateInfoBoxImage(box) rescales it.
getPriority()InfoBoxPriority?The priority (default NONE).
setPriority(InfoBoxPriority?)()The priority: HIGH boxes come first, then MED, NONE, LOW; within one, by plugin name. Read when the box is added.
getTooltip()string?The hover tooltip (<br>, <col=>), or nil.
setTooltip(string?)()The hover tooltip.
getMenuEntries(){OverlayMenuEntry}The live list of the box's shift-right-click entries (the manager adds Detach, Flip and, outside the default group, Delete).
setMenuEntries({OverlayMenuEntry})()Replaces the list.
isInstance(any)booleanWhether obj is an instance of this class or a subclass of it, as made with class.
new(BufferedImage?, any?)InfoBoxThe constructor: the image, the plugin, priority NONE. A subclass calls it as X.super.init(self, image, plugin).

Returned by

MethodReturnsDescription
InfoBoxClass.newInfoBoxThe constructor: the image, the plugin, priority NONE. A subclass calls it as X.super.init(self, image, plugin).
InfoBoxManager.getInfoBoxes{InfoBox}This plugin's boxes, group by group in the manager's order.

Method details

getText

getText: (InfoBox) -> string?

The caption. Abstract: a subclass defines it.

render

render: (InfoBox) -> boolean

Whether to show the box this frame: true; override it. Anything but true hides it.

cull

cull: (InfoBox) -> boolean

Whether to remove the box (asked once a game tick): false; override it.

getName

getName: (InfoBox) -> string

The key its detached group is saved under: <plugin>_<class> (see the class doc). Override it to choose another.

setPriority

setPriority: (InfoBox, InfoBoxPriority?) -> ()

The priority: HIGH boxes come first, then MED, NONE, LOW; within one, by plugin name. Read when the box is added.

getMenuEntries

getMenuEntries: (InfoBox) -> {OverlayMenuEntry}

The live list of the box's shift-right-click entries (the manager adds Detach, Flip and, outside the default group, Delete).

isInstance

isInstance: (any) -> boolean

Whether obj is an instance of this class or a subclass of it, as made with class.

new

new: (BufferedImage?, any?) -> InfoBox

The constructor: the image, the plugin, priority NONE. A subclass calls it as X.super.init(self, image, plugin).