View: Rewrite

This commit is contained in:
LoveEevee
2018-10-25 17:18:41 +03:00
parent ab2e3d2417
commit f90f6fe6e1
18 changed files with 1511 additions and 978 deletions

View File

@@ -27,6 +27,7 @@ class CanvasAsset{
}else{
frame = this.mod(this.animation, index)
}
this.ctx.save()
var pos = this.position(frame)
if(this.image){
this.ctx.drawImage(this.image,
@@ -35,9 +36,7 @@ class CanvasAsset{
pos.x, pos.y, pos.w, pos.h
)
}
if(pos.callback){
pos.callback()
}
this.ctx.restore()
}
}
mod(length, index){