Created
September 28, 2010 21:06
-
-
Save julians/601777 to your computer and use it in GitHub Desktop.
Beispiel für die tuioZones-Processing-Library
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
import oscP5.*; | |
import netP5.*; | |
import tuioZones.*; | |
TUIOzoneCollection zones; | |
void setup () | |
{ | |
size(640, 480); | |
zones = new TUIOzoneCollection(this); | |
// eine Zone namens "rectangle" definieren | |
zones.setZone("rectangle", 30, 30, 100, 100); | |
// Zone verschiebbar machen | |
zones.setZoneParameter("rectangle", "DRAGGABLE", true); | |
// Zone skalierbar machen | |
zones.setZoneParameter("rectangle", "SCALABLE", true); | |
} | |
void draw () | |
{ | |
background(255); | |
noStroke(); | |
fill(0); | |
// die aktuellen X- und Y-Koordinaten der Zone "rectangle" speichern | |
float recX = zones.getZoneX("rectangle"); | |
float recY = zones.getZoneY("rectangle"); | |
// Breite und Höhe der Zone "rectangle" speichern | |
float recWidth = zones.getZoneWidth("rectangle"); | |
float recHeight = zones.getZoneHeight("rectangle"); | |
// ein Rechteck mit den eben gerade gespeicherten Sachen malen | |
rect(recX, recY, recWidth, recHeight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment