This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
users:shilo:extensions:shline [2012/08/21 00:28] – [Data entry] 67.181.243.216 | users:shilo:extensions:shline [2013/03/05 10:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SHLine ====== | ||
+ | ---- dataentry extension ---- | ||
+ | type : extension | ||
+ | author_mail | ||
+ | description | ||
+ | lastupdate_dt : 2011-03-14 | ||
+ | compatible | ||
+ | depends | ||
+ | tags : line, primitive | ||
+ | homepage_url | ||
+ | download_url | ||
+ | sample_url | ||
+ | ---- | ||
+ | ===== Description ===== | ||
+ | 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, | ||
+ | |||
+ | ===== Sample ===== | ||
+ | [[http:// | ||
+ | * Project: [[http:// | ||
+ | * Screenshot: [[http:// | ||
+ | * Recording: [[http:// | ||
+ | |||
+ | ===== Example ===== | ||
+ | <code objc> | ||
+ | // | ||
+ | SHLine *line = [SHLine lineWithLength: | ||
+ | |||
+ | //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: | ||
+ | |||
+ | // | ||
+ | SHLine *line2 = [SHLine lineWithCoords: | ||
+ | |||
+ | //set the line thickness to 5 pixels | ||
+ | line2.thickness = 5; | ||
+ | |||
+ | //add line2 to the stage to create a ' | ||
+ | [self addChild: | ||
+ | </ | ||
+ | |||
+ | ===== Instructions ===== | ||
+ | ==== To add into your Sparrow project ==== | ||
+ | - Download the source files here: [[https:// | ||
+ | - Open your desired Sparrow project | ||
+ | - Drag and drop the files into the " | ||
+ | - Open " | ||
+ | - Include the extension: <code objc># | ||
+ | - Save " | ||
+ | |||
+ | ==== To add directly into Sparrow source ==== | ||
+ | - Download the source files here: [[https:// | ||
+ | - Save the files into Sparrow' | ||
+ | * Example: "/ | ||
+ | - Navigate back one directory and open " | ||
+ | * Example: "/ | ||
+ | - Inside the " | ||
+ | * Example: " | ||
+ | - Right click the " | ||
+ | - Navigate into the "/ | ||
+ | - On the next window, leave all options as default and click " | ||
+ | - In the " | ||
+ | * Example " | ||
+ | - At the bottom of the file, add: <code objc># | ||
+ | - Save " | ||
+ | - Close " | ||
+ | |||
+ | ===== Source Code ===== | ||
+ | %gist(870169)% | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | * // | ||
+ | |||
+ | ===== Todo ===== | ||
+ | * Add anti-aliasing | ||
+ | * Use Core Graphics instead of OpenGL ES | ||
+ | * Add new initialization methods | ||
+ | |||
+ | ===== Special Thanks ===== | ||
+ | * [[http:// |