Class: MineSkin::Preview::Cape2D
- Inherits:
-
Object
- Object
- MineSkin::Preview::Cape2D
- Includes:
- Compositor, Unit
- Defined in:
- lib/mineskin/preview/cape2d.rb
Instance Method Summary collapse
-
#initialize(cape_data) ⇒ Cape2D
constructor
A new instance of Cape2D.
- #render(width, background: 'white') ⇒ Object
Methods included from Compositor
Methods included from Unit
Constructor Details
#initialize(cape_data) ⇒ Cape2D
Returns a new instance of Cape2D.
9 10 11 |
# File 'lib/mineskin/preview/cape2d.rb', line 9 def initialize(cape_data) @cape_data = cape_data end |
Instance Method Details
#render(width, background: 'white') ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/mineskin/preview/cape2d.rb', line 13 def render(width, background: 'white') @unit = image_unit size: width, count: 40 @image = Magick::Image.new(width, 65 * width / 100) do self.background_color = background end render_cape! @image end |