forked from: FlasherTest
to @chomeco http://d.hatena.ne.jp/chomeco/20100413/1271243823
/**
* Copyright cpu_t ( http://wonderfl.net/user/cpu_t )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/bJUv
*/
// forked from yd_niku's FlasherTest
//to @chomeco http://d.hatena.ne.jp/chomeco/20100413/1271243823
package {
import flash.display.*;
import flash.text.*;
public class FlasherTest extends Sprite {
public function FlasherTest() {
// write as3 code here..
var すぎゃーん:全裸 = new 全裸("ずぎゃーん");
すぎゃーん.x = 232;
すぎゃーん.y = 232;
addChild( すぎゃーん );
var message:TextField = new TextField();
var tf:TextFormat = new TextFormat();
tf.align = "center";
message.defaultTextFormat = tf;
message.y = 360;
message.width = 465;
message.height = 32;
message.text = "僕すぎゃーん。全裸なの。僕に服を着せてよ!!";
addChild(message);
}
}
}
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
class 全裸 extends Sprite{
private var _skinColor:uint = 0;
private var _pantsColor:uint = 0;
public function 全裸( name:String ){
super();
super.name = name;
_skinColor = 0xCC9966;
_pantsColor = 0xF0F0F0;
draw();
}
protected function draw():void {
var pants:Sprite = new Sprite();
this.addChild(pants);
pants.graphics.beginFill(_pantsColor);
graphics.beginFill( _skinColor );
const angle:Number = Math.PI*2 / 10;
const offsetAngle:Number = -Math.PI / 2;
for( var i:int=0; i< 10;++i ){
var isOut:Boolean = i%2 == 0;
var r:Number = isOut ? 100: 60;
var tx:Number = Math.cos( angle*i + offsetAngle )*r;
var ty:Number = Math.sin( angle*i + offsetAngle )*r;
if ( i == 0 ) graphics.moveTo( tx, ty );
if (i == 3) pants.graphics.moveTo(tx, ty);
if (!isOut && i >= 3 && i <= 7 )
{
pants.graphics.lineTo(tx, ty);
}
graphics.lineTo( tx, ty );
}
graphics.endFill();
pants.graphics.endFill();
graphics.beginFill( _skinColor );
graphics.drawCircle( 0,-100, 60 );
graphics.endFill();
var す:TextField = new TextField();
す.defaultTextFormat = new TextFormat("_sans", 36, 0x0, true )
す.autoSize = "left";
す.text = "す"
す.x = -18;
す.y = -140;
addChild( す );
}
}