class RIImage
Attributes
color[RW]
height[RW]
image[RW]
width[RW]
x[RW]
y[RW]
Public Class Methods
new(opts={})
click to toggle source
# File lib/RIUI/RIImage.rb, line 5 def initialize(opts={}) @path = opts[:image] || "/" @x = opts[:x] || 0 @y = opts[:y] || 0 @width = opts[:width] || 0 @height = opts[:height] || 0 @image = Image.new(path: @path, x: @x, y: @y, width: @width, height: @height) end
Public Instance Methods
setColor(opts=[:color])
click to toggle source
# File lib/RIUI/RIImage.rb, line 19 def setColor(opts=[:color]) @image.color = opts[:color] end
setSize(opts=[:width, :height])
click to toggle source
# File lib/RIUI/RIImage.rb, line 13 def setSize(opts=[:width, :height]) @width = opts[:width] @height = opts[:height] @image.remove @image = Image.new(path: @path, x: @x-@width/2, y: @y-@height/2, width: @width, height: @height) end