class Text

text.rb

Attributes

c[R]
color[R]
content[R]
h[R]
x[RW]
y[RW]

Public Class Methods

new(x=0, y=0, h=50, content="Hello World!", c="white", visible=true) click to toggle source
# File lib/r2d/text.rb, line 8
def initialize(x=0, y=0, h=50, content="Hello World!", c="white", visible=true)
  @x, @y, @h, @content, @color = x, y, h, content, c
  update_color(c)
  @text = R2D::Adapters.text(h)
  if visible then add end
end

Public Instance Methods

adapter() click to toggle source
# File lib/r2d/text.rb, line 32
def adapter
  @text
end
add() click to toggle source
# File lib/r2d/text.rb, line 24
def add
  R2D::Window.add(self)
end
color=(c) click to toggle source
# File lib/r2d/text.rb, line 15
def color=(c)
  @color = c
  update_color(c)
end
content=(c) click to toggle source
# File lib/r2d/text.rb, line 20
def content=(c)
  @content = c
end
remove() click to toggle source
# File lib/r2d/text.rb, line 28
def remove
  R2D::Window.remove(self)
end

Private Instance Methods

update_color(c) click to toggle source
# File lib/r2d/text.rb, line 38
def update_color(c)
  @c = R2D::Color.new(c)
end