Class: MinMaxText
- Inherits:
-
Object
- Object
- MinMaxText
- Defined in:
- lib/display.rb
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(w, min = 0, max = 5) ⇒ MinMaxText
constructor
A new instance of MinMaxText.
Constructor Details
#initialize(w, min = 0, max = 5) ⇒ MinMaxText
Returns a new instance of MinMaxText.
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/display.rb', line 2 def initialize(w,min=0,max=5) @window = w @width = @window.scope_width @height = @window.height @font = Gosu::Font.new(12) @min = min @max = max end |
Instance Method Details
#draw ⇒ Object
13 14 15 16 |
# File 'lib/display.rb', line 13 def draw @font.draw("#{@max}v", @width-20, 10, 0, 1.0, 1.0, 0xff_ffff00) @font.draw("#{@min}v", @width-20, @height-20, 0, 1.0, 1.0, 0xff_ffff00) end |