Object \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name
Object
Examples
// Declare and contruct two objects (h1, h2) from the class HLine
HLine h1 = new HLine(20, 2.0);
HLine h2 = new HLine(50, 2.5);
void setup()
{
size(200, 200);
frameRate(30);
}
void draw() {
background(204);
h1.update();
h2.update();
}
class HLine {
float ypos, speed;
HLine (float y, float s) {
ypos = y;
speed = s;
}
void update() {
ypos += speed;
if (ypos > width) {
ypos = 0;
}
line(0, ypos, width, ypos);
}
}
Description
Objects are instances of classes. A class is a grouping of related methods (functions) and fields (variables and constants).
Syntax
classinstance
Parameters
class
the class to created the object from
instance
any variable name
Usage
Web & Application
Related
class
Updated on November 22, 2008 08:39:26pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
stream writer objectsObjectImplfunction hwapi object remove110 Amazing Magic Tricks With Everyday Objectsfunction pg fetch objectObjectsubject object questionsObjectbltin code objectsPrettyPrinter Objectscontent handler objectsObjectStreamFieldevent objectscraft objectssocket objectsuse objectwięcej podobnych podstron