Increased scroll speed and added window_size_changed event for containers that is thrown from the root container

This commit is contained in:
2021-01-31 13:33:20 -06:00
parent af24fc8690
commit d050f63c2b
2 changed files with 7 additions and 2 deletions

View File

@@ -11,11 +11,13 @@ module CyberarmEngine
super super
@scroll_position = Vector.new(0, 0) @scroll_position = Vector.new(0, 0)
@scroll_speed = 10 @scroll_speed = 40
@text_color = options[:color] @text_color = options[:color]
@children = [] @children = []
event(:window_size_changed)
end end
def build def build

View File

@@ -105,7 +105,10 @@ module CyberarmEngine
@last_mouse_pos = Vector.new(window.mouse_x, window.mouse_y) @last_mouse_pos = Vector.new(window.mouse_x, window.mouse_y)
@mouse_pos = @last_mouse_pos.clone @mouse_pos = @last_mouse_pos.clone
request_recalculate if @active_width != window.width || @active_height != window.height if @active_width != window.width || @active_height != window.height
request_recalculate
@root_container.publish(:window_size_changed)
end
@active_width = window.width @active_width = window.width
@active_height = window.height @active_height = window.height