This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
users:shilo:extensions:shshakeevent [2012/08/21 00:34] – [Data entry] 67.181.243.216 | users:shilo:extensions:shshakeevent [2013/03/05 10:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SHShakeEvent ====== | ||
+ | ---- dataentry extension ---- | ||
+ | type : extension | ||
+ | author_mail | ||
+ | description | ||
+ | lastupdate_dt : 2011-03-20 | ||
+ | compatible | ||
+ | depends | ||
+ | tags : shake, event, shakeevent | ||
+ | homepage_url | ||
+ | download_url | ||
+ | sample_url | ||
+ | ---- | ||
+ | ===== Description ===== | ||
+ | SHShakeEvent class will allow you to easily listen to shake events inside Sparrow. | ||
+ | |||
+ | ===== Sample ===== | ||
+ | [[http:// | ||
+ | * Project: [[http:// | ||
+ | * Screenshot: [[http:// | ||
+ | * Recording: [[http:// | ||
+ | |||
+ | ===== Example ===== | ||
+ | <code objc> | ||
+ | @implementation Game | ||
+ | - (id)initWithWidth: | ||
+ | if (self = [super initWithWidth: | ||
+ | [self addEventListener: | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | |||
+ | - (void)onShake: | ||
+ | if (event.phase == SHShakePhaseBegan) { | ||
+ | NSLog(@" | ||
+ | } else if (event.phase == SHShakePhaseEnded) { | ||
+ | NSLog(@" | ||
+ | } else if (event.phase == SHShakePhaseCancelled) { | ||
+ | NSLog(@" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | - (void)dealloc { | ||
+ | [self removeEventListener: | ||
+ | [super dealloc]; | ||
+ | } | ||
+ | @end | ||
+ | </ | ||
+ | |||
+ | ===== 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(878254)% | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | * // | ||
+ | |||
+ | ===== Todo ===== | ||
+ | * (EMPTY) | ||
+ | |||
+ | ===== Special Thanks ===== | ||
+ | * [[http:// |