Sha256: 30103423bb5eacfecb1b424bb5125113cfa4b6cd0c080f05387f505ff0a387a7
Contents?: true
Size: 550 Bytes
Versions: 9
Compression:
Stored size: 550 Bytes
Contents
require 'ruby-processing' # Loads a "mask" for an image to specify the transparency # in different parts of the image. The two images are blended # together using the mask() method of PImage. class Alphamask < Processing::App def setup @image = load_image "test.jpg" @image_mask = load_image "mask.jpg" @image.mask @image_mask end def draw background (mouse_x + mouse_y) / 1.5 image @image, 50, 50 image @image, mouse_x-50, mouse_y-50 end end Alphamask.new :title => "Alphamask", :width => 200, :height => 200
Version data entries
9 entries across 9 versions & 1 rubygems