Sha256: d21c6d7f70148f8e5f642337dd5aea8e164fc6efe7674b21ea4ebee520611a14
Contents?: true
Size: 738 Bytes
Versions: 13
Compression:
Stored size: 738 Bytes
Contents
module Processing # Draws graphics into an offscreen buffer # class Graphics include Xot::Inspectable include GraphicsContext # Initialize graphics object. # def initialize(width, height, pixelDensity = 1) image = Rays::Image.new width, height, Rays::RGBA, pixelDensity init__ image, image.painter end # Start drawing. # def beginDraw(&block) beginDraw__ @painter__.__send__ :begin_paint push if block begin block.call self ensure endDraw end end end # End drawing. # def endDraw() pop @painter__.__send__ :end_paint endDraw__ end end# Graphics end# Processing
Version data entries
13 entries across 13 versions & 1 rubygems