Class: Hokusai::Commands::Circle

Inherits:
Base
  • Object
show all
Defined in:
ui/src/hokusai/commands/circle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#after_draw, draw, #draw, on_draw

Constructor Details

#initialize(x, y, radius) ⇒ Circle

Returns a new instance of Circle.



6
7
8
9
10
11
12
13
# File 'ui/src/hokusai/commands/circle.rb', line 6

def initialize(x, y, radius)
  @x = x
  @y = y
  @radius = radius
  @color = Color.new(255, 255, 255, 255)
  @outline_color = Color.new(0, 0, 0, 0)
  @outline = 0.0
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def color
  @color
end

#outlineObject

Returns the value of attribute outline.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def outline
  @outline
end

#outline_colorObject

Returns the value of attribute outline_color.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def outline_color
  @outline_color
end

#radiusObject (readonly)

Returns the value of attribute radius.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def radius
  @radius
end

#xObject (readonly)

Returns the value of attribute x.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



3
4
5
# File 'ui/src/hokusai/commands/circle.rb', line 3

def y
  @y
end

Instance Method Details

#hashObject



15
16
17
# File 'ui/src/hokusai/commands/circle.rb', line 15

def hash
  [self.class, x, y, radius, color.hash, outline_color.hash, outline].hash
end