» codelab : http://codelab.fr/accueil » Forum : Processing : http://codelab.fr/processing » saisi de texte et surface : http://codelab.fr/6316 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : saisi de texte et surface |
Thyurn — 2016-05-23 13:47:40 |
Bonjour ! |
Mushussu — 2016-05-23 21:43:45 |
Bonsoir, PImage img; PVector position; void setup() { size(200, 200); img = loadImage("http://images.techtimes.com/data/images/full/26160/hubble-image-of-the-orion-nebula.jpg"); position = new PVector(img.width / 2, img.height / 2); } void draw() { image(img, width / 2 - position.x, height / 2 - position.y); } void keyPressed() { if ((keyCode == RIGHT) && (position.x < img.width - width / 2)) { position.x += 10; } if ((keyCode == LEFT) && (position.x > width / 2)) { position.x -= 10; } if ((keyCode == DOWN) && (position.y < img.height - height / 2)) { position.y += 10; } if ((keyCode == UP) && (position.y > height / 2)) { position.y -= 10; } } |
Thyurn — 2016-05-24 10:13:42 |
Merci pour c'est précieuses informations, on va décortiquer tout ça et faire des essais, merci beaucoup ! |