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, #init__, #line, #noFill, #noStroke, #point, #pop, #popMatrix, #popStyle, #push, #pushMatrix, #pushStyle, #quad, #rect, #rectMode, #resetMatrix, #rotate, #scale, #square, #stroke, #strokeCap, #strokeJoin, #strokeWeight, #text, #textAlign, #textAscent, #textDescent, #textFont, #textSize, #textWidth, #translate, #triangle, #updateCanvas__, #width

Constructor Details

#initialize(width, height) ⇒ Graphics

Initialize graphics object.



1718
1719
1720
1721
# File 'lib/rubysketch/processing.rb', line 1718

def initialize (width, height)
  image = Rays::Image.new width, height
  init__ image, image.painter
end

Instance Method Details

#beginDraw(&block) ⇒ Object

Start drawing.



1725
1726
1727
1728
1729
1730
1731
1732
1733
# File 'lib/rubysketch/processing.rb', line 1725

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

#endDrawObject

End drawing.



1737
1738
1739
1740
1741
# File 'lib/rubysketch/processing.rb', line 1737

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