Method: Wads::Widget#initialize

Defined in:
lib/wads/widgets.rb

#initialize(x, y, width = 10, height = 10, layout = nil, theme = nil) ⇒ Widget

Returns a new instance of Widget.



998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
# File 'lib/wads/widgets.rb', line 998

def initialize(x, y, width = 10, height = 10, layout = nil, theme = nil) 
    set_absolute_position(x, y)  
    set_dimensions(width, height)
    @base_z = 0
    if uses_layout
        if layout.nil? 
            @layout = WadsConfig.instance.create_layout(x, y, width, height, self)
        else
            @layout = layout
        end
    end
    if theme.nil?
        @gui_theme = WadsConfig.instance.current_theme
    else 
        @gui_theme = theme 
    end
    @visible = true 
    @children = []
    @show_background = true
    @show_border = true 
    @is_selected = false
    @text_input_fields = []
end