topical media & game development
#graphic-flex-image-effects-01-Flex-DrawTrianglesIndicesTest.ax
#graphic-flex-image-effects-01-Flex-DrawTrianglesIndicesTest.ax
[swf]
[flash]
flex
package {
import flash.display.Sprite;
[SWF(width=550, height=400, backgroundColor=0xFFFFFF)]
Demonstrates simple use of drawing triangles using a sold fill.
Indices are used to define two triangles using four vertices.
public class @ax-graphic-flex-image-effects-01-Flex-DrawTrianglesIndicesTest extends Sprite {
Constructor. Handles the drawing.
public function @ax-graphic-flex-image-effects-01-Flex-DrawTrianglesIndicesTest() {
var vertices:Vector.<Number> = new Vector.<Number>();
vertices.push(100, 50);
vertices.push(150, 100);
vertices.push(50, 100);
vertices.push(100, 150);
var indices:Vector.<int> = new Vector.<int>();
indices.push(0, 1, 2);
indices.push(1, 2, 3);
graphics.beginFill(0xFF);
graphics.drawTriangles(vertices, indices);
graphics.endFill();
}
}
}
(C) Æliens
04/09/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.