Added flags to use ffi-gosu optionally instead of always trying, made tooltip affected by theme (the last set theme in setup will be used to style the tooltip)

This commit is contained in:
2021-03-12 08:33:16 -06:00
parent 1e0d2004b5
commit abb989f842
5 changed files with 16 additions and 6 deletions

View File

@@ -26,12 +26,15 @@ module CyberarmEngine
@dragging_element = nil
@pending_recalculate_request = false
@tip = Element::ToolTip.new("", parent: @root_container, z: Float::INFINITY)
@menu = nil
@min_drag_distance = 0
@mouse_pos = Vector.new
end
def post_setup
@tip = Element::ToolTip.new("", parent: @root_container, z: Float::INFINITY, theme: current_theme)
end
# throws :blur event to focused element and sets GuiState focused element
# Does NOT throw :focus event at element or set element as focused
def focus=(element)
@@ -103,7 +106,7 @@ module CyberarmEngine
@tip.x = window.mouse_x - @tip.width / 2
@tip.x = 0 if @tip.x < 0
@tip.x = window.width - @tip.width if @tip.x + @tip.width > window.width
@tip.y = window.mouse_y - @tip.height
@tip.y = window.mouse_y - (@tip.height + 5)
@tip.y = 0 if @tip.y < 0
@tip.y = window.height - @tip.height if @tip.y + @tip.height > window.height
@tip.update