Sha256: 911d1e8e8fbd230523f481e8782a41ac762bd8a5668d17053d404cebda147da1
Contents?: true
Size: 741 Bytes
Versions: 23
Compression:
Stored size: 741 Bytes
Contents
require 'processing/all' module Processing w = (ENV['WIDTH'] || 500).to_i h = (ENV['HEIGHT'] || 500).to_i WINDOW = Processing::Window.new(w, h) {start} CONTEXT = Processing::Context.new WINDOW refine Object do (CONTEXT.methods - Object.instance_methods).each do |method| define_method method do |*args, **kwargs, &block| CONTEXT.__send__ method, *args, **kwargs, &block end end end end# Processing begin w, c = Processing::WINDOW, Processing::CONTEXT c.class.constants.each do |const| self.class.const_set const, c.class.const_get(const) end w.__send__ :begin_draw at_exit do w.__send__ :end_draw Processing::App.new {w.show}.start if c.hasUserBlocks__ && !$! end end
Version data entries
23 entries across 23 versions & 1 rubygems