Class: Conquer::Dzen::Graphics::Graphic
- Inherits:
-
Object
- Object
- Conquer::Dzen::Graphics::Graphic
- Includes:
- Positioning
- Defined in:
- lib/conquer/dzen/graphics/graphic.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ Graphic
constructor
A new instance of Graphic.
- #move(x, y) ⇒ Object
- #to_s ⇒ Object
Methods included from Positioning
#ignore_bg, #lock_x, #shift, #unlock_x
Constructor Details
#initialize ⇒ Graphic
Returns a new instance of Graphic.
9 10 11 12 |
# File 'lib/conquer/dzen/graphics/graphic.rb', line 9 def initialize @x_shift = 0 @y_shift = 0 end |
Instance Method Details
#move(x, y) ⇒ Object
14 15 16 17 18 |
# File 'lib/conquer/dzen/graphics/graphic.rb', line 14 def move(x, y) @x_shift += x @y_shift += y self end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/conquer/dzen/graphics/graphic.rb', line 20 def to_s shift(@x_shift, @y_shift) { render } end |