Created
March 15, 2012 13:04
-
-
Save noboko/2044107 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plask = require('plask'); | |
plask.simpleWindow({ | |
settings:{ | |
width:1280,height:720, | |
type: '3d2d', | |
//fullscreen: true | |
}, | |
syphon_server: 'PLASK', | |
init: function() { | |
//var canvas = this.canvas;//, paint = this.paint; | |
//var path = new plask.SkPath(); | |
this.framerate(30); | |
// Set the paint to fill an anti-aliased dark red. | |
//paint.setFill(); // Fill is the default, so this is just for clarity. | |
//paint.setAntiAlias(true); | |
//paint.setColor(80, 0, 0, 255); | |
}, | |
draw: function() { | |
var canvas = this.canvas, paint = this.paint, i=0, maxx=100; | |
paint.setColor(1, 1, 1, 40); | |
paint.setFontFamily("Osaka"); | |
canvas.drawRect(paint, 0, 0, 1280, 720); | |
for(i; i < maxx ;i += 1){ | |
paint.setColor(Math.floor(Math.random()*255), Math.floor(Math.random()*255), Math.floor(Math.random()*255), 255); | |
canvas.drawCircle(paint, Math.random()*1920, Math.random()*1200, Math.random()*100); | |
paint.setColor(Math.floor(Math.random()*255), Math.floor(Math.random()*255), Math.floor(Math.random()*255), 255); | |
//paint.setTextSize(Math.floor(Math.random()*500)); | |
//canvas.rotate(Math.floor(Math.random()*360)); | |
//canvas.drawText(paint, "ころね", Math.random()*1920, Math.random()*1200); | |
//paint.setColor(Math.floor(Math.random()*255), Math.floor(Math.random()*255), Math.floor(Math.random()*255), 255); | |
//canvas.drawRect(paint, Math.floor(Math.random()*1920), Math.floor(Math.random()*1200), Math.floor(Math.random()*1920), Math.floor(Math.random()*1200)) | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment