class ResolutionSetting

require_relative “config_settings.rb”

Constants

FULLSCREEN_NAME
NAME
SELECTION

Public Instance Methods

get_values() click to toggle source

def initialize fullscreen_height, max_width, max_height, height, config_file_path

@font = Gosu::Font.new(20)
# @x = width
@y = height
@max_width = max_width
@max_height = max_height
@next_x = 15
@prev_x = @max_width - 15 - @font.text_width('>')
@config_file_path = config_file_path
@name = get_name
@value = ConfigSetting.get_setting(@config_file_path, @name, SELECTION[0])
@fullscreen = false
@fullscreen_height = fullscreen_height

end

# File line-em-up/lib/resolution_setting.rb, line 25
def get_values
  if @value == FULLSCREEN_NAME
    height = @fullscreen_height
    width = (@fullscreen_height / 3) * 4
    [width, height, true]
  elsif @value
    @value.split('x').collect{|s| s.to_i }
  end
end