SHLine class will allow you to create primitive lines on the stage. You can customize both vertex colors and alpha, change the thickness, set the destination to the end of the line, and everything else you can do with an SPDisplayObject, such as rotation.
//initialize a line with a length of 100 pixels and thickness of 5 pixels SHLine *line = [SHLine lineWithLength:100 andThickness:5]; //set the start color to red line.startColor = 0xff0000; //set the end color to blue line.endColor = 0x0000ff; //set the start opacity to 75% line.startAlpha = 0.75f; //set the end opacity to 25% line.endAlpha = 0.25f; //set the end destination to the bottom right corner of the screen line.x2 = 320; line.y2 = 480; //add the line to the stage [self addChild:line]; //initialize another line with the coords (x, y, width, height) SHLine *line2 = [SHLine lineWithCoords:0:480:320:-480]; //set the line thickness to 5 pixels line2.thickness = 5; //add line2 to the stage to create a 'cross' pattern [self addChild:line2];
#include "SHLine.h"
#import "SHLine.h"