Toggle navigation
Explora
(current)
Aprende
Crea
Retos
×
Aspectos básicos
void main() {...}
for ( int i = 0 ; i < N ; i++ ) {...}
while (condición) {...}
do {...} while (condición);
if (condición) {...}
if (condición) {...} else {...}
switch (valor) {...}
Mostrar y pedir datos
print()
println()
readInteger()
readDouble()
readChar()
readString()
Funciones matemáticas
abs(n)
log(n)
sqrt(n)
pow(b,e)
floor(n)
ceil(n)
round(n)
sin(n)
cos(n)
tan(n)
asin(n)
acos(n)
atan(n)
random(n)
Funciones gráficas
point(x,y)
line(x1,y1,x2,y2)
ellipse(x,y,w,h)
rect(x,y,w,h)
triangle(x1,y1,x2,y2,x3,y3)
text(msg,x,y)
textWidth(msg)
textSize(n)
background(r,g,b,a)
strokeWeight(n)
stroke(r,g,b,a)
noStroke()
fill(r,g,b,a)
noFill()
image(url, x,y,w,h)
Nuevo
Ayuda
Probar
...
// Mi primera vez usando la función image() en algún programa en Descubre void main() { animate(draw); } void textCenter(String txt, int x, int y, double size) { textSize(round(size)); int nx = x-(textWidth(txt)/2); int ny = round(y-(size/2)); text(txt, nx, ny); } void draw() { background(0); stroke(200); fill(200); int start_n = 0; if (mouseX >= 0 && mouseX <= 99) { if (mouseY >= 290) { start_n += 50; if (mousePressed) { start_n += 50; } } } image("https://i.ibb.co/bR1JHDH/step0001.png", 0, 290, 320, 31); image("http://www.mediafire.com/convkey/d65f/53d57940e70a1316g.jpg", 0, 280-start_n, 99, 151); image("https://i.ibb.co/FHgFpqW/Desktop2-Full.png", 240, 291, 320, 31); image("https://i.ibb.co/g4Fzdq4/Desktop2-Full-1.png", 240, 289, 30, 32); image("https://upload.wikimedia.org/wikipedia/en/2/27/Bliss_%28Windows_XP%29.png", 0, 0, 320, 290); image("https://i.ibb.co/Vq1pJ66/image-part-001.png", 10, 10, 32, 32); image("https://i.ibb.co/PQ92fmL/image-part-002.png", 82, 10, 32, 32); image("https://i.ibb.co/qyWGdpF/image-part-040.png", 10, 82, 32, 32); image("https://i.ibb.co/RvdrNTx/image-part-167.png", 10, 154, 32, 32); }
Canvas not supported.
Programado por
segfaultdev
0 votos
187 descargas
33 usos