zoukankan      html  css  js  c++  java
  • Rectangle 、getBounds(this)

    var container:Sprite = new Sprite();
    container.graphics.beginFill(0xffff00);
    container.graphics.drawCircle(0,0,100);
    container.graphics.endFill();
    container.x = 200;
    container.y = 200;
    addChild(container);
    var bounds:Rectangle = container.getBounds(this);
    trace("bounds.top======="+bounds.top);
    
    /*var contents:Shape = new Shape();
    contents.graphics.beginFill(0xff00ff);
    contents.graphics.drawCircle(0,0,50);
    contents.graphics.endFill();
    container.addChild(contents);*/
    
    //trace("contents.getBounds(container)======"+contents.getBounds(container));
    // (x=-100, y=-100, w=200, h=200)
    
    
    //trace("contents.getBounds(this)======="+contents.getBounds(this));
    // (x=0, y=0, w=200, h=200)
    
  • 相关阅读:
    io
    文件
    诚实
    没有犯错并不代表自己就是做得好
    脑力锻炼的随缘
    电路运算
    “容错率”
    GPU简介
    名与责任
    失眠和精神的思考
  • 原文地址:https://www.cnblogs.com/602147629/p/1961047.html
Copyright © 2011-2022 走看看