class Quad

quad.rb

Attributes

c1[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

c2[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

c3[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

c4[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

color[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

x1[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

x2[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

x3[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

x4[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

y1[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

y2[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

y3[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

y4[R]

x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right

Public Class Methods

new(x1, y1, x2, y2, x3, y3, x4, y4, c="white", visible=true) click to toggle source
# File lib/r2d/quad.rb, line 14
def initialize(x1, y1, x2, y2, x3, y3, x4, y4, c="white", visible=true)
  @x1, @y1, @x2, @y2, @x3, @y3, @x4, @y4 = x1, y1, x2, y2, x3, y3, x4, y4
  @color = c
  update_color(c)
  if visible then add end
end

Public Instance Methods

add() click to toggle source
# File lib/r2d/quad.rb, line 26
def add
  R2D::Window.add(self)
end
color=(c) click to toggle source
# File lib/r2d/quad.rb, line 21
def color=(c)
  @color = c
  update_color(c)
end
remove() click to toggle source
# File lib/r2d/quad.rb, line 30
def remove
  R2D::Window.remove(self)
end

Private Instance Methods

update_color(c) click to toggle source
# File lib/r2d/quad.rb, line 36
def update_color(c)
  @c1 = R2D::Color.new(c)
  @c2 = R2D::Color.new(c)
  @c3 = R2D::Color.new(c)
  @c4 = R2D::Color.new(c)
end