class Fidgit::ToolTip

Public Class Methods

new(options = {}, &block) click to toggle source

@param (see Label#initialize)

@option (see Label#initialize)

Calls superclass method Fidgit::TextLine::new
# File lib/fidgit/elements/tool_tip.rb, line 13
def initialize(options = {}, &block)
  options = {
    z: Float::INFINITY,
    background_color: default(:background_color),
    border_color: default(:border_color),
    text: '',
  }.merge! options

  super(options[:text], options)
end

Public Instance Methods

hit?(x, y) click to toggle source
# File lib/fidgit/elements/tool_tip.rb, line 7
def hit?(x, y); false; end
x=(value) click to toggle source
Calls superclass method Fidgit::Element#x=
# File lib/fidgit/elements/tool_tip.rb, line 5
def x=(value); super(value); recalc; value; end
y=(value) click to toggle source
Calls superclass method Fidgit::Element#y=
# File lib/fidgit/elements/tool_tip.rb, line 6
def y=(value); super(value); recalc; value; end

Protected Instance Methods

layout() click to toggle source
Calls superclass method Fidgit::TextLine#layout
# File lib/fidgit/elements/tool_tip.rb, line 25
def layout
  super

  # Ensure the tip can't go over the edge of the screen. If it can't be avoided, align with left edge of screen.
  rect.x = [[x, $window.width - width - padding_right].min, 0].max
  rect.y = [[y, $window.height - height - padding_bottom].min, 0].max

  nil
end