Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
outerspace
outerspace's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
tuioZones - animating zones problem
[0 Replies]
26-Jun-2012 01:30 PM
Forum:
Contributed Library Questions
I made a simple sketch to show the problem. The aim is to move Zone to the left (using setZoneData) when it's not pressed on. It works until I try to drag it when it jumps to a point where I dropped it last time.
here's the code:
import oscP5.*;
import netP5.*;
import tuioZones.*;
TUIOzoneCollection zones;
void setup() {
size(640, 360);
background(0);
noFill();
stroke(255);
zones = new TUIOzoneCollection(this);
zones.setZone("object1", 240, 180, 24);
zones.setZoneParameter("object1", "DRAGGABLE", true);
}
void draw() {
background(0);
// draw the zone
ellipse(
zones.getZoneX("object1"),
zones.getZoneY("object1"),
zones.getZoneWidth("object1"),
zones.getZoneHeight("object1")
);
// move the zone if it is not pressed and not out of frame
if (!zones.isZonePressed("object1") && zones.getZoneX("object1") < width - 24) {
zones.setZoneData(
"object1",
zones.getZoneX("object1") + 1,
zones.getZoneY("object1"),
24
);
}
}
tuioZones 0.2.0
Processing 2.0a6
thanks a lot!
«Prev
Next »
Moderate user : outerspace
Forum