Modifications

Aller à : navigation, rechercher

Aide:Accueil

1 398 octets ajoutés, 7 septembre 2012 à 14:43
Comment contribuer à ce wiki ?
Il faut s'inscrire sur le site (en haut à droite) pour pouvoir éditer une page
{{#widget:Pjs
|nom=deux
|code=void setup(){
size( 200, 200 );
strokeWeight( 10 );
background(151,45,12);
}
void draw(){
background(151,45,12);
ellipse( mouseX, mouseY, 100, 100 );
}
}}
===créer une page===
===faire du code processingjs===
<processingjs>
/*
PROCESSINGJS.COM - BASIC EXAMPLE
Delayed Mouse Tracking
MIT License - Hyper-Metrix.com/F1LT3R
Native Processing compatible
*/
 
// Global variables
float radius = 50.0;
int X, Y;
int nX, nY;
int delay = 16;
 
// Setup the Processing Canvas
void setup(){
size( 600, 200 );
strokeWeight( 10 );
frameRate( 15 );
X = width / 2;
Y = width / 2;
nX = X;
nY = Y;
}
 
// Main draw loop
void draw(){
radius = radius + sin( frameCount / 4 );
// Track circle to new destination
X+=(nX-X)/delay;
Y+=(nY-Y)/delay;
// Fill canvas grey
background( 120 );
// Set fill-color to blue
fill( 0, 12, 184 );
// Set stroke-color white
stroke(255);
// Draw circle
ellipse( X, Y, radius, radius );
}
 
// Set circle's next destination
void mouseMoved(){
nX = mouseX;
nY = mouseY;
}
<nowiki/processingjs>{{#widget:Pjs|nom=deux|code=void setup(){
<nowiki><processingjs>/* PROCESSINGJS.COM - BASIC EXAMPLE Delayed Mouse Tracking MIT License - Hyper-Metrix.com/F1LT3R Native Processing compatible */  // Global variablesfloat radius = 50.0;int X, Y;int nX, nY;int delay = 16; // Setup the Processing Canvasvoid setup(){ size( 200600, 200 ); strokeWeight( 10 );background frameRate(151,45,1215 ); X = width / 2; Y = width / 2; nX = X; nY = Y;
}
 
// Main draw loop
void draw(){
radius = radius + sin( frameCount / 4 ); // Track circle to new destination X+=(nX-X)/delay; Y+=(nY-Y)/delay; // Fill canvas grey background(151120 ); // Set fill-color to blue fill( 0,4512,12184 ); // Set stroke-color white stroke(255); // Draw circle ellipse( mouseXX, mouseYY, 100radius, 100 radius );
}
  // Set circle's next destinationvoid mouseMoved(){ nX = mouseX; nY = mouseY; }} </processingjs></nowiki>
===afficher le contenu d'une catégorie===
0
6 691
modifications

Menu de navigation