hiloteam / Hilo

A Cross-end HTML5 Game development solution
https://hiloteam.github.io/
MIT License
5.93k stars 863 forks source link

如何给view添加drag功能 #90

Closed fleurWang closed 7 years ago

fleurWang commented 7 years ago

我想拖拽这个飞机对象

 this.plane = new game.Plane({
            id: 'plane',
            image: this.asset.plane,
            X: 60,
            y: 500
        }).addTo(this.stage);
// 官方文档里这样说
//  可以通过 Class.mix(view, drag)或Hilo.util.copy(view, drag)来为view增加拖拽功能。
// 但是我用的时候  Hilo.util报undefind   this.plane对象也没有mix方法
06wj commented 7 years ago

http://hiloteam.github.io/Hilo/examples/drag.html