Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created August 9, 2019 15:53
Show Gist options
  • Select an option

  • Save jamesmichiemo/ac12e5a058d0a7ac85ca4195ceb18f0c to your computer and use it in GitHub Desktop.

Select an option

Save jamesmichiemo/ac12e5a058d0a7ac85ca4195ceb18f0c to your computer and use it in GitHub Desktop.
processing + propane sketch
#!/usr/bin/env jruby
# frozen_string_literal: false
require 'propane'
# multiple mouse buttons
# propane graffiti by 8mana
# based on code by Casey Reas and Ben Fry
class MouseButtons < Propane::App
def settings
size 120, 120
end
def setup
sketch_title 'multiple mouse buttons'
strokeWeight 30
end
def draw
background 204
stroke 102
line 40, 0, 70, height
mouse_button == LEFT ? stroke(0) : stroke(255) if mouse_pressed?
line 0, 70, width, 50
end
end
MouseButtons.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment