mikipoint - shinku/miki-es6 GitHub Wiki

mikipoint

miki的point

属性们

  • x :number
    set/get 方法

  • y: number
    set/get 方法

sample

import {minkpoint,DisplayObject,stage} from 'miki'
const p=new mikipint();
console.log(p.x,p.y)// 默认输出0,0
const a=new DisplayObject();
p.x=30;
p.y=30;
stage.addChild(a);
a.x=100;
a.y=100;
const newp = a.localToGlobal(p);
console.log(newp)//返回DisplayObject对象a内部坐标(30,30)的全局坐标(x:130,y:130)