JS

Nambafa

Graphics tutorials


[ Nambafa's pixel graphics tutorial : Part 7 ]

Sandbox

This is an "empty" tutorial for playing with stuff through the console...

app.stop()
var rect = MyPixelShape.new_rect(25,25,[255,0,0])
var elli = MyPixelShape.new_ellipse(10,10,[255,0,0],10)
elli=elli.color(function(x,y,i){return [0,100 + 155 * ((y+5)/10),0];})
rect.put(app.buffer,100,100)
app.buffer.putpixel(100,100,[0,255,0])
rect.scale(2.0,0.8).rotate(0.2).put(app.buffer,200,200)
elli.scale(5,2).put(app.buffer,300,100)
elli.scale(0.8,2.0).rotate(-0.4).put(app.buffer,350,200)
app.canvas.publish(app.buffer)

Demo

Here comes the demo of today's applet - just press start to check it out! :)