Created
August 7, 2019 16:02
-
-
Save jamesmichiemo/3a59773986bab0768832362b84b0ca2c to your computer and use it in GitHub Desktop.
processing + propane sketch
This file contains hidden or 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' | |
| # map with the map function | |
| # propane graffiti by 8mana | |
| # based on code by Casey Reas and Ben Fry | |
| class MapFunction < Propane::App | |
| def settings | |
| size 240, 120 | |
| end | |
| def setup | |
| sketch_title 'map values to a range' | |
| strokeWeight 12 | |
| end | |
| def draw | |
| background 204 | |
| stroke 255 | |
| line 120, 60, mouseX, mouseY | |
| stroke 0 | |
| mx = p5map mouseX, 0, width, 60, 180 | |
| line 120, 60, mx, mouseY | |
| end | |
| end | |
| MapFunction.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment