=begin @file gamegui @class Screen A screen defines a list of so called selectors. Selectors are the items you can go through, like "start," "quit," "name." A screen takes a bunch of them and is able to "run" them, showing them on screen, letting the user go through them and use them. =end module GameGUI class Screen attr_accessor :display_surface attr_accessor :area, :font, :color, :select_color, :selectors attr_reader :left_column_width, :right_column_width attr_reader :row_height attr_accessor :pre_draw, :post_draw attr_accessor :on_start, :on_quit attr_reader :selectors_by_id def initialize(display_surface, area, font, color, select_color, selectors) @display_surface=display_surface @area=area @font=font @color=color @select_color=select_color @selectors=selectors @left_column_width=0 @selectors_by_id={} self.current_selector_index=0 @selectors.each do |selector| selector.screen=self @left_column_width=selector.w if @left_column_width