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::ALT, RubySketch::Processing::GraphicsContext::BACKSPACE, RubySketch::Processing::GraphicsContext::BASELINE, RubySketch::Processing::GraphicsContext::BOTTOM, RubySketch::Processing::GraphicsContext::BUTT, RubySketch::Processing::GraphicsContext::CAPSLOCK, RubySketch::Processing::GraphicsContext::CENTER, RubySketch::Processing::GraphicsContext::CLEAR, RubySketch::Processing::GraphicsContext::COMMAND, RubySketch::Processing::GraphicsContext::CONTROL, RubySketch::Processing::GraphicsContext::CORNER, RubySketch::Processing::GraphicsContext::CORNERS, RubySketch::Processing::GraphicsContext::DEGREES, RubySketch::Processing::GraphicsContext::DELETE, RubySketch::Processing::GraphicsContext::DOWN, RubySketch::Processing::GraphicsContext::ENTER, RubySketch::Processing::GraphicsContext::ESC, RubySketch::Processing::GraphicsContext::F1, RubySketch::Processing::GraphicsContext::F10, RubySketch::Processing::GraphicsContext::F11, RubySketch::Processing::GraphicsContext::F12, RubySketch::Processing::GraphicsContext::F13, RubySketch::Processing::GraphicsContext::F14, RubySketch::Processing::GraphicsContext::F15, RubySketch::Processing::GraphicsContext::F16, RubySketch::Processing::GraphicsContext::F17, RubySketch::Processing::GraphicsContext::F18, RubySketch::Processing::GraphicsContext::F19, RubySketch::Processing::GraphicsContext::F2, RubySketch::Processing::GraphicsContext::F20, RubySketch::Processing::GraphicsContext::F21, RubySketch::Processing::GraphicsContext::F22, RubySketch::Processing::GraphicsContext::F23, RubySketch::Processing::GraphicsContext::F24, RubySketch::Processing::GraphicsContext::F3, RubySketch::Processing::GraphicsContext::F4, RubySketch::Processing::GraphicsContext::F5, RubySketch::Processing::GraphicsContext::F6, RubySketch::Processing::GraphicsContext::F7, RubySketch::Processing::GraphicsContext::F8, RubySketch::Processing::GraphicsContext::F9, RubySketch::Processing::GraphicsContext::FUNCTION, RubySketch::Processing::GraphicsContext::HALF_PI, RubySketch::Processing::GraphicsContext::HELP, RubySketch::Processing::GraphicsContext::HOME, RubySketch::Processing::GraphicsContext::HSB, RubySketch::Processing::GraphicsContext::LEFT, RubySketch::Processing::GraphicsContext::MITER, RubySketch::Processing::GraphicsContext::OPTION, RubySketch::Processing::GraphicsContext::PAGEDOWN, RubySketch::Processing::GraphicsContext::PAGEUP, 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::SECTION, RubySketch::Processing::GraphicsContext::SHIFT, RubySketch::Processing::GraphicsContext::SPACE, RubySketch::Processing::GraphicsContext::SQUARE, RubySketch::Processing::GraphicsContext::TAB, RubySketch::Processing::GraphicsContext::TAU, RubySketch::Processing::GraphicsContext::TOP, RubySketch::Processing::GraphicsContext::TWO_PI, RubySketch::Processing::GraphicsContext::UP, RubySketch::Processing::GraphicsContext::WIN

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.



1767
1768
1769
1770
# File 'lib/rubysketch/processing.rb', line 1767

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

Instance Method Details

#beginDraw(&block) ⇒ Object

Start drawing.



1774
1775
1776
1777
1778
1779
1780
1781
1782
# File 'lib/rubysketch/processing.rb', line 1774

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

#endDrawObject

End drawing.



1786
1787
1788
1789
1790
# File 'lib/rubysketch/processing.rb', line 1786

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