SHPolygon class will allow you to create primitive polygon shapes on the stage. You can set the number of sides, customize inner color, outer color, border color, change the border width, toggle the fill and border, set the center x, center y, change the radius x, radius y, rotate around center, and everything else you can do with an SPDisplayObject.
//add a triangle with default sides: 3 SHPolygon *triangle = [SHPolygon polygonWithWidth:100 height:100]; [self addChild:triangle]; //add a diamond shape SHPolygon *diamond = [SHPolygon polygonWithWidth:320 height:480]; diamond.sides = 4; [self addChild:diamond]; //add a star and center it on stage SHPolygon *star = [SHPolygon polygonWithWidth:320 height:320]; star.sides = 5; star.innerColor = 0xffffff; star.outerColor = 0x000000; star.centerX = 320/2; star.centerY = 480/2; [self addChild:star]; //add a circle with default width and height: 32 SHPolygon *circle = [SHPolygon polygon]; circle.sides = 360; [self addChild:circle];
#include "SHPolygon.h"
#import "SHPolygon.h"