Sha256: b80bc06ec85a7980172cf26fb20063ba6b30ff205e85160cbd4df49d6d158692

Contents?: true

Size: 435 Bytes

Versions: 10

Compression:

Stored size: 435 Bytes

Contents

# The createImage() function provides a fresh buffer of pixels to play with.
# This example creates an image gradient.


def setup
  size 640, 360
  @image = create_image 230, 230, ARGB
  @image.pixels.length.times do |i|
    @image.pixels[i] = color 0, 90, 102, (i % @image.width * 2) # red, green, blue, alpha
  end
end

def draw
  background 204
  image @image, 90, 80
  image @image, mouse_x-@image.width, mouse_y-@image.width
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.6.2 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.6.1 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.6.0 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.5.1 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.5.0 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.4.4 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.4.3 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.4.2 samples/processing_app/basics/image/create_image.rb
ruby-processing-2.4.1 samples/processing_app/basics/image/create_image.rb