Skip to content

TooltipBase ​

Inherits: MarginContainer

Inherited by: TooltipAbility, TooltipDescription, TooltipEffect, TooltipEntity, TooltipItem, TooltipSkillNode

The base of the five tooltips: the margin from the edges of the screen, and the label settings they share (font, font size, outline and shadow), which are set on the root node of each tooltip scene.

Properties ​

PlacementplacementPlacement.MOUSE
ScreenCornerfixed_cornerScreenCorner.BOTTOM_RIGHT
Vector2fixed_offsetVector2(16, 16)
Fontfont
intfont_size14
intoutline_size1
Coloroutline_colorColor.BLACK
intshadow_size1
Colorshadow_colorColor.BLACK
Vector2shadow_offsetVector2(1, 1)

Variables ​

LabelSettingslabel_settings

Methods ​

voidset_systems_refs( system_hub: GameHost.SystemHub )
voidapply_label_settings( label: Label )
voidapply_label_settings_to_container( container: Control )
voidshow_tooltip( value: bool = true )
voidposition_tooltip()
voidclear_container( container: Control )

Enumerations ​

enum Placement ​

Where a tooltip appears: next to the mouse, or at a fixed place of the screen

  • MOUSE = 0 - next to the mouse pointer (the default)
  • FIXED = 1 - at the place set by Fixed corner and Fixed offset, whatever the mouse does

enum ScreenCorner ​

The corner (or the middle) of the screen a fixed tooltip is placed from

  • TOP_LEFT = 0
  • TOP_RIGHT = 1
  • BOTTOM_LEFT = 2
  • BOTTOM_RIGHT = 3
  • CENTER = 4

Constants ​

  • int SCREEN_MARGIN = 4 - Default margin from screen edges

Property descriptions ​

Placement

Placement placement = Placement.MOUSE ​

Next to the mouse (default), or at a fixed place of the screen. Each tooltip scene has its own setting

ScreenCorner fixed_corner = ScreenCorner.BOTTOM_RIGHT ​

For a fixed tooltip: the corner of the screen it is placed from. The tooltip is anchored by the same corner of itself, so it grows away from the corner

Vector2 fixed_offset = Vector2(16, 16) ​

For a fixed tooltip: the distance from that corner in pixels, towards the inside of the screen (from the middle: right and down)

Label Settings

Font font ​

Font to use for all labels (except item name)

int font_size = 14 ​

Font size for all labels

int outline_size = 1 ​

Outline size for labels

Color outline_color = Color.BLACK ​

Outline color

int shadow_size = 1 ​

Shadow size for labels

Color shadow_color = Color.BLACK ​

Shadow color

Vector2 shadow_offset = Vector2(1, 1) ​

Shadow offset

Variable descriptions ​

LabelSettings label_settings ​

Cached label settings resource

Method descriptions ​

void set_systems_refs( system_hub: GameHost.SystemHub ) ​

Gives the tooltip the hub of the game systems.

void apply_label_settings( label: Label ) ​

Apply label settings to a label (excludes item name label)

void apply_label_settings_to_container( container: Control ) ​

Apply label settings to all labels in a container

void show_tooltip( value: bool = true ) ​

Shows the tooltip, or hides it.

void position_tooltip() ​

Base positioning logic that all tooltips will use: next to the mouse, or at the fixed place

void clear_container( container: Control ) ​

Helper function for clearing containers that all tooltips use