class Image
image.rb
Attributes
f_x[R]
f_y[R]
height[R]
width[R]
x[RW]
y[RW]
Public Class Methods
new(x, y, path, visible=true)
click to toggle source
# File lib/r2d/image.rb, line 8 def initialize(x, y, path, visible=true) @x, @y, @path = x, y, path @f_x, @f_y = 1, 1 @image = R2D::Adapters.image(path) @o_w, @o_h = @image.width, @image.height @width, @height = @o_w, @o_h if visible then add end end
Public Instance Methods
adapter()
click to toggle source
# File lib/r2d/image.rb, line 35 def adapter @image end
add()
click to toggle source
# File lib/r2d/image.rb, line 27 def add R2D::Window.add(self) end
height=(h)
click to toggle source
# File lib/r2d/image.rb, line 22 def height=(h) @f_y = h / @o_h.to_f @height = h end
remove()
click to toggle source
# File lib/r2d/image.rb, line 31 def remove R2D::Window.remove(self) end
width=(w)
click to toggle source
# File lib/r2d/image.rb, line 17 def width=(w) @f_x = w / @o_w.to_f @width = w end