module FN::SWF::Node

Public Instance Methods

Break() click to toggle source
# File lib/fn/swf/node/break.rb, line 5
def Break
  FN::Node::Base("break").extend(Break)
end
Flash(width, height) click to toggle source
# File lib/fn/swf/node/flash.rb, line 5
def Flash(width, height)
  FN::Node::Base("flash", :width => width, :height => height).extend(Flash)
end
Font(name, file) click to toggle source
# File lib/fn/swf/node/font.rb, line 6
def Font(name, file)
  FN::Node::Base("font", :name => name, :file => file).extend(Font)
end
Frame(name, file) click to toggle source
# File lib/fn/swf/node/frame.rb, line 5
def Frame(name, file)
  FN::Node::Base("frame", :name => name, :file => file).extend(Frame)
end
HotSpot(page) click to toggle source
# File lib/fn/swf/node/hot_spot.rb, line 5
def HotSpot(page)
  x, y, x2, y2 = page[:hotspot].gsub(/\s/, '').split(",").map{|s| s.to_i}
  w = x2 - x
  h = y2 - y
  FN::Node::Base("hot_spot", :x => x, :y => y, :w => w, :h => h, :n => page[:number]).extend(HotSpot)
end
Image(name, file) click to toggle source
# File lib/fn/swf/node/image.rb, line 5
def Image(name, file)
  FN::Node::Base("image", :name => name, :file => file).extend(Image)
end
Page(number, bkg) click to toggle source
# File lib/fn/swf/node/page.rb, line 6
def Page(number, bkg)
  FN::Node::Base("page", :number => number, :bkg => bkg).extend(Page)
end
PhotoBlock(node, image_dims = {}) click to toggle source
# File lib/fn/swf/node/photo_block.rb, line 6
def PhotoBlock(node, image_dims = {})
  dims = image_dims[node[:src]]
  FN::Node::Base("photo_block", node.attributes.to_h.update(
    :orig_width => dims[0],
    :orig_height => dims[1]
  )).extend(PhotoBlock)
end
Text(node, alt_text) click to toggle source
# File lib/fn/swf/node/text.rb, line 5
def Text(node, alt_text)
  out = FN::Node::Base("text", node.attributes.to_h)
  out.extend(Text)
  out.text = node.children.to_s
  out.text = alt_text                  if out.text.empty?
  out
end