topical media & game development
actionscript-wii-Triangle.ax
actionscript-wii-Triangle.ax
[swf]
flex
package
{
import flash.display.Graphics;
public class @ax-actionscript-wii-Triangle
{
private var pointA:actionscript_wii_Point3D;
private var pointB:actionscript_wii_Point3D;
private var pointC:actionscript_wii_Point3D;
private var color:uint;
public function @ax-actionscript-wii-Triangle(a:actionscript_wii_Point3D, b:actionscript_wii_Point3D, c:actionscript_wii_Point3D, color:uint)
{
pointA = a;
pointB = b;
pointC = c;
this.color = color;
}
public function draw(g:Graphics):void
{
g.beginFill(color, 0.5);
g.moveTo(pointA.screenX, pointA.screenY);
g.lineTo(pointB.screenX, pointB.screenY);
g.lineTo(pointC.screenX, pointC.screenY);
g.lineTo(pointA.screenX, pointA.screenY);
g.endFill();
}
}
}
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.