Class: RubySketch::Processing::Graphics

Inherits:
Object
  • Object
show all
Includes:
GraphicsContext
Defined in:
lib/rubysketch/processing.rb

Overview

Draws graphics into an offscreen buffer

Constant Summary

Constants included from GraphicsContext

RubySketch::Processing::GraphicsContext::BASELINE, RubySketch::Processing::GraphicsContext::BOTTOM, RubySketch::Processing::GraphicsContext::BUTT, RubySketch::Processing::GraphicsContext::CENTER, RubySketch::Processing::GraphicsContext::CORNER, RubySketch::Processing::GraphicsContext::CORNERS, RubySketch::Processing::GraphicsContext::DEGREES, RubySketch::Processing::GraphicsContext::HALF_PI, RubySketch::Processing::GraphicsContext::HSB, RubySketch::Processing::GraphicsContext::LEFT, RubySketch::Processing::GraphicsContext::MITER, RubySketch::Processing::GraphicsContext::PI, RubySketch::Processing::GraphicsContext::QUARTER_PI, RubySketch::Processing::GraphicsContext::RADIANS, RubySketch::Processing::GraphicsContext::RADIUS, RubySketch::Processing::GraphicsContext::RGB, RubySketch::Processing::GraphicsContext::RIGHT, RubySketch::Processing::GraphicsContext::ROUND, RubySketch::Processing::GraphicsContext::SQUARE, RubySketch::Processing::GraphicsContext::TAU, RubySketch::Processing::GraphicsContext::TOP, RubySketch::Processing::GraphicsContext::TWO_PI

Instance Method Summary collapse

Methods included from GraphicsContext

#angleMode, #arc, #background, #bezier, #circle, #colorMode, #copy, #curve, #ellipse, #ellipseMode, #fill, #height, #image, #imageMode, #line, #noFill, #noStroke, #point, #pop, #popMatrix, #popStyle, #push, #pushMatrix, #pushStyle, #quad, #rect, #rectMode, #resetMatrix, #rotate, #scale, #setup__, #square, #stroke, #strokeCap, #strokeJoin, #strokeWeight, #text, #textAlign, #textAscent, #textDescent, #textFont, #textSize, #textWidth, #translate, #triangle, #width

Constructor Details

#initialize(width, height) ⇒ Graphics

Initialize graphics object.



1714
1715
1716
1717
# File 'lib/rubysketch/processing.rb', line 1714

def initialize (width, height)
  @image__ = Rays::Image.new width, height
  setup__ @image__.painter
end

Instance Method Details

#beginDraw(&block) ⇒ Object

Start drawing.



1721
1722
1723
1724
1725
1726
1727
1728
1729
# File 'lib/rubysketch/processing.rb', line 1721

def beginDraw (&block)
  @painter__.__send__ :begin_paint
  beginDraw__
  push
  if block
    block.call
    endDraw
  end
end

#endDrawObject

End drawing.



1733
1734
1735
1736
1737
# File 'lib/rubysketch/processing.rb', line 1733

def endDraw ()
  pop
  endDraw__
  @painter__.__send__ :end_paint
end