nandeck-ruby/lib/nandeck/primitives/image.rb

21 lines
589 B
Ruby
Raw Normal View History

2013-10-10 02:51:03 +00:00
module Nandeck
class Image < Primitive
attr_reader :card_index, :filename, :x, :y, :width, :height, :options
def initialize(card_index, filename, x, y, width, height, options = {})
options = {
angle: 0,
flag: "PN",
alpha_channel: 100
}.merge(options)
@card_index, @filename, @x, @y, @width, @height, @options = card_index, filename, x, y, width, height, options
end
def to_s
%{IMAGE = #{@card_index}, "#{@filename}", #{geometry}, #{@options[:angle]}, #{@options[:flag]}, #{@options[:alpha_channel]}}
end
end
end