Sha256: 327eeba73198571906fb6b972c22b09f301591ee5a564b30e8c9e9dbb86bf643

Contents?: true

Size: 644 Bytes

Versions: 8

Compression:

Stored size: 644 Bytes

Contents

module Processing


  # Draws graphics into an offscreen buffer
  #
  class Graphics

    include Xot::Inspectable
    include GraphicsContext

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

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

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

  end# Graphics


end# Processing

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
processing-0.5.14 lib/processing/graphics.rb
processing-0.5.13 lib/processing/graphics.rb
processing-0.5.12 lib/processing/graphics.rb
processing-0.5.11 lib/processing/graphics.rb
processing-0.5.10 lib/processing/graphics.rb
processing-0.5.9 lib/processing/graphics.rb
processing-0.5.8 lib/processing/graphics.rb
processing-0.5.6 lib/processing/graphics.rb