Class: Conquer::Dzen::Graphics::Graphic

Inherits:
Object
  • Object
show all
Includes:
Positioning
Defined in:
lib/conquer/dzen/graphics/graphic.rb

Direct Known Subclasses

Circle, Icon, ProgressBar, Rectangle

Instance Method Summary collapse

Methods included from Positioning

#ignore_bg, #lock_x, #shift, #unlock_x

Constructor Details

#initializeGraphic

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_sObject



20
21
22
# File 'lib/conquer/dzen/graphics/graphic.rb', line 20

def to_s
  shift(@x_shift, @y_shift) { render }
end