Class: Scruffy::Renderers::Empty

Inherits:
Base
  • Object
show all
Defined in:
lib/scruffy/renderers/empty.rb

Overview

Scruffy::Renderers::Empty

Author

Brasten Sager

Date

August 17th, 2006

An Empty graph isn’t completely empty, it adds a background componenet to itself before handing other all other layout responsibilities to it’s subclasses or caller.

Direct Known Subclasses

Cubed, Cubed3d, Split, Standard

Instance Attribute Summary

Attributes inherited from Base

#options

Attributes included from Helpers::Canvas

#components

Instance Method Summary collapse

Methods inherited from Base

#before_render, #initialize, #method_missing, #render

Methods included from Helpers::Canvas

#component, #remove, #reset_settings!

Constructor Details

This class inherits a constructor from Scruffy::Renderers::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Scruffy::Renderers::Base

Instance Method Details

#define_layout {|self.components| ... } ⇒ Object

Returns a renderer with just a background.

If a block is provided, the components array is passed to the block, allowing callers to add components during initialize.

Yields:



16
17
18
19
20
# File 'lib/scruffy/renderers/empty.rb', line 16

def define_layout
  self.components << Scruffy::Components::Background.new(:background, :position => [0,0], :size =>[100, 100])      

  yield(self.components) if block_given?
end