Class: CyberarmEngine::Element::Menu
- Inherits:
-
Stack
- Object
- CyberarmEngine::Element
- Container
- Stack
- CyberarmEngine::Element::Menu
- Defined in:
- lib/cyberarm_engine/ui/elements/menu.rb
Constant Summary
Constants included from Theme
Instance Attribute Summary
Attributes inherited from Container
#children, #fill_color, #gui_state, #scroll_position, #scroll_target_position, #stroke_color
Attributes inherited from CyberarmEngine::Element
#background_canvas, #border_canvas, #element_visible, #event_handler, #options, #parent, #style, #tip, #x, #y, #z
Instance Method Summary collapse
Methods inherited from Stack
Methods inherited from Container
#add, #append, #build, #clear, current_container, current_container=, #debug_draw, #fits_on_line?, #hit_element?, #initialize, #layout, #max_width, #mouse_wheel_down, #mouse_wheel_up, #move_to_next_line, #position_on_current_line, #position_on_next_line, #remove, #render, #scroll_jump_to_end, #scroll_jump_to_top, #scroll_page_down, #scroll_page_up, #scroll_top, #scroll_top=, #tallest_neighbor, #to_s, #update, #update_child_element_visibity, #update_scroll, #value, #write_tree
Methods included from Common
#alt_down?, #control_down?, #current_state, #darken, #draw_rect, #fill, #find_element_by_tag, #get_asset, #get_image, #get_sample, #get_song, #lighten, #opacity, #pop_state, #previous_state, #push_state, #shift_down?, #shift_state, #show_cursor, #show_cursor=, #window
Methods inherited from CyberarmEngine::Element
#background=, #background_image=, #background_nine_slice=, #blur, #button_down, #button_up, #child_of?, #clicked_left_mouse_button, #content_height, #content_width, #debug_draw, #default_events, #dimensional_size, #draggable?, #draw, #element_visible?, #enabled=, #enabled?, #enter, #focus, #focused?, #height, #hide, #hit?, #initialize, #inner_height, #inner_width, #inspect, #is_root?, #layout, #leave, #left_mouse_button, #max_scroll_height, #max_scroll_width, #noncontent_height, #noncontent_width, #outer_height, #outer_width, #parent_of?, #recalculate_if_size_changed, #released_left_mouse_button, #render, #reposition, #root, #safe_style_fetch, #scroll_height, #scroll_width, #set_background, #set_background_image, #set_background_nine_slice, #set_border_color, #set_border_thickness, #set_color, #set_font, #set_margin, #set_padding, #set_static_position, #space_available_height, #space_available_width, #stylize, #to_s, #toggle, #update, #update_background, #update_background_image, #update_background_nine_slice, #update_styles, #value, #value=, #visible?, #width
Methods included from CyberarmEngine::Event
#event, #publish, #subscribe, #unsubscribe
Methods included from Theme
#deep_merge, #default, #theme_defaults
Constructor Details
This class inherits a constructor from CyberarmEngine::Element::Container
Instance Method Details
#recalculate ⇒ Object
4 5 6 7 8 |
# File 'lib/cyberarm_engine/ui/elements/menu.rb', line 4 def recalculate super end |
#recalculate_menu ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/cyberarm_engine/ui/elements/menu.rb', line 10 def # FIXME: properly find scrollable parent, if any. parent_scroll_top = parent&.parent ? parent.parent.scroll_top : 0 @x = @parent.x @y = parent_scroll_top + @parent.y + @parent.height @y = (parent_scroll_top + @parent.y) - height if @y + height > window.height end |
#show ⇒ Object
20 21 22 23 24 |
# File 'lib/cyberarm_engine/ui/elements/menu.rb', line 20 def show recalculate root.gui_state.(self) end |