Created
August 10, 2019 01:59
-
-
Save jamesmichiemo/0aa4b988bfe073d958f5bcedca1c598e to your computer and use it in GitHub Desktop.
processing + propane sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
# frozen_string_literal: false | |
require 'propane' | |
# the bounds of a rectangle | |
# propane graffiti by 8mana | |
# based on code by Casey Reas and Ben Fry | |
class RectangleBounds < Propane::App | |
def settings | |
size 240, 120 | |
end | |
def setup | |
sketch_title 'the bounds of a rectangle' | |
$x = 80 | |
$y = 30 | |
$w = 80 | |
$h = 60 | |
end | |
def draw | |
background 204 | |
if ((mouseX > $x) && (mouseX < $x+$w) && | |
(mouseY > $y) && (mouseY < $y+$h)) | |
fill 0 | |
else | |
fill 255 | |
end | |
rect $x, $y, $w, $h | |
end | |
end | |
RectangleBounds.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment