在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:soulwire/sketch.js开源软件地址:https://github.com/soulwire/sketch.js开源编程语言:JavaScript 89.6%开源软件介绍:sketch.jsA tiny (~2kb gzipped) platform for JavaScript creative coding. A few examples from the showcase Start Coding Fastersketch.js lets you get straight to the fun parts of creative coding, without ever having to worry about shims or boilerplate code. It gives you a graphics context, an animation loop, normalised input events and a host of useful callbacks to hook into. Here's an example: Sketch.create({
setup() {
this.r = this.g = this.b = random(100, 200)
},
mousemove() {
this.r = 255 * (this.mouse.x / this.width)
this.g = 255 * (this.mouse.y / this.height)
this.b = 255 * abs(cos(PI * this.mouse.y / this.width))
},
draw() {
this.fillStyle = `rgb(${~~this.r},${~~this.g},${~~this.b})`
this.fillRect(0, 0, this.width, this.height)
}
}) The Highlights
The RestFor more information, check out the getting started guide, the API, the many examples in the showcase and the full source. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论