Class: CyberarmEngine::Element::Flow

Inherits:
Container show all
Defined in:
lib/cyberarm_engine/ui/elements/flow.rb

Direct Known Subclasses

CheckBox

Constant Summary

Constants included from Theme

Theme::THEME

Instance Attribute Summary

Attributes inherited from Container

#children, #fill_color, #gui_state, #scroll_x, #scroll_y, #stroke_color

Attributes inherited from CyberarmEngine::Element

#background_canvas, #border_canvas, #enabled, #event_handler, #options, #parent, #style, #tip, #x, #y, #z

Instance Method Summary collapse

Methods inherited from Container

#add, #build, #clear, #fits_on_line?, #hit_element?, #initialize, #max_width, #move_to_next_line, #position_on_current_line, #position_on_next_line, #recalculate, #render, #tallest_neighbor, #to_s, #update, #value, #write_tree

Methods included from Common

#current_state, #darken, #draw_rect, #fill, #get_asset, #get_image, #get_sample, #get_song, #lighten, #opacity, #pop_state, #previous_state, #push_state, #show_cursor, #show_cursor=, #window

Methods inherited from CyberarmEngine::Element

#background=, #button_down, #button_up, #content_height, #content_width, #default_events, #dimensional_size, #draggable?, #draw, #enabled?, #height, #hide, #hit?, #initialize, #inner_height, #inner_width, #is_root?, #noncontent_height, #noncontent_width, #outer_height, #outer_width, #recalculate, #render, #reposition, #root, #set_background, #set_border_color, #set_border_thickness, #set_margin, #set_padding, #set_static_position, #show, #stylize, #to_s, #toggle, #update, #update_background, #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

#layoutObject



4
5
6
7
8
9
10
11
12
# File 'lib/cyberarm_engine/ui/elements/flow.rb', line 4

def layout
  @children.each do |child|
    if fits_on_line?(child)
      position_on_current_line(child)
    else
      position_on_next_line(child)
    end
  end
end