⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ellipse.as

📁 精通Actionscript 3.0 书籍源代码 非常实用
💻 AS
字号:
package org.moock.drawing {
  // Represents an ellipse that can be drawn to the screen
  public class Ellipse extends BasicShape {
    // The width and height of the ellipse
    protected var w:Number;
    protected var h:Number;
    
    // Constructor
    public function Ellipse (width:Number = 100, height:Number = 100) {
      super();
      setSize(width, height);
    }

    // The ellipse drawing routine
    override protected function drawShape ():void { 
      graphics.drawEllipse(0, 0, w, h);
    }
    
    // Sets the width and height of the ellipse
    public function setSize (newWidth:Number, newHeight:Number):void {
      w = newWidth;
      h = newHeight;

      // Setting the width and height of the ellipse changes its shape, 
      // so it must be redrawn at the next render opportunity.
      setChanged();
    }  
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -