Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
vetril
vetril's Profile
1
Posts
1
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
Change sketch size according to content (non-dynamic)
[2 Replies]
04-Jun-2011 05:31 PM
Forum:
Programming Questions
Hi there,
this is a simplification of a longer and more complex code I'm working on...
let's say I have a rectangle with random size and I want to change the size of the sketch so that it equals the width of the rectangle + 10.
How do I do that?
The problem:
void setup() {
size(300,300);
background(255);
int recw = int(random(250,800));
rect(10,10, recw, recw);
width = recw+10;
height = recw+10;
}
void draw() {
}
«Prev
Next »
Moderate user : vetril
Forum