KaBoom-rawdraw
最后更新于
这有帮助吗?
最后更新于
这有帮助吗?
范例来自
首先初始化并且引入目录和图片,并使用loadSprite("car", "img/car.png", {sliceX: 3,});
进行切割
核心代码是包裹在一个render
之中的,代表循环
在这里的的draw似乎不需要如processing里面还需要手动擦除
展示了 drawSprite(“”,{})
绘制动画图集 drawRect()
drawLine
drawText(,)
loadSprite(name, src, [conf])
加载序列帧并且手动添加动画的方式
render(tag,cb)
calls every frame for a certain tag (after update) 会进行每帧的调用 with plain action() and render() you can opt out of the component / obj system and use you own loop 通过action() 和 render() 的方法可以跳出原先的component / obj 的系统来构建自己的循环
time()
标识的是 current game time
dt()
是 delta time since last frame
mousePos()
current mouse position
~~
这个运算法代表着取整:That ~~
is a double NOT bitwise operator. It is used as a for positive numbers. It does not return the same result as Math.floor()
for negative numbers, as it just chops off the part after the decimal (see other answers for examples of this).