This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
users:shilo:extensions:shsplashscreen [2011/03/26 23:40] – [Constants] shilo | users:shilo:extensions:shsplashscreen [2013/03/05 10:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== SHSplashScreen ====== | ||
+ | ---- dataentry extension ---- | ||
+ | type : extension | ||
+ | author_mail | ||
+ | description | ||
+ | lastupdate_dt : 2011-03-26 | ||
+ | compatible | ||
+ | depends | ||
+ | tags : splash, splashscreen, | ||
+ | homepage_url | ||
+ | download_url | ||
+ | sample_url | ||
+ | ---- | ||
+ | ===== Description ===== | ||
+ | SHSplashScreen class will allow you to create splash screens with only a few lines of code. You can set the start/end transitions, | ||
+ | |||
+ | ===== Sample ===== | ||
+ | [[http:// | ||
+ | * Project: [[http:// | ||
+ | * Screenshot: [[http:// | ||
+ | * Recording: [[http:// | ||
+ | |||
+ | ===== Example ===== | ||
+ | <code objc> | ||
+ | // | ||
+ | SHSplashScreen *splashScreen = [SHSplashScreen splashScreenWithTime: | ||
+ | |||
+ | // | ||
+ | SPImage *logo = [SPImage imageWithContentsOfFile: | ||
+ | [splashScreen addChild: | ||
+ | |||
+ | //add the splash screen to the stage, it will automatically start and automatically remove itself from the stage when finished. | ||
+ | [self addChild: | ||
+ | </ | ||
+ | |||
+ | ===== Documentation ===== | ||
+ | See [[# | ||
+ | |||
+ | ===== 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(888135)% | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | * // | ||
+ | |||
+ | ===== Todo ===== | ||
+ | * (EMPTY) | ||
+ | |||
+ | ---- | ||
+ | ===== API Reference ===== | ||
+ | | Inherits from | [[http:// | ||
+ | | Declared in | SHSplashScreen.h | | ||
+ | |||
+ | ==== Overview ==== | ||
+ | ---- | ||
+ | SHSplashScreen will function similar to a SPSprite. After initializing, | ||
+ | |||
+ | ==== Instance Methods ==== | ||
+ | ---- | ||
+ | === init ==== | ||
+ | Returns an initialized // | ||
+ | <code objc>- (id)init</ | ||
+ | === initWithTime: | ||
+ | Returns an initialized // | ||
+ | <code objc>- (id)initWithTime: | ||
+ | |||
+ | ==== Class Methods ==== | ||
+ | ---- | ||
+ | === splashScreen ==== | ||
+ | Returns an auto-released initialized // | ||
+ | <code objc>+ (SHSplashScreen *)splashScreen</ | ||
+ | === splashScreenWithTime: | ||
+ | Returns an auto-released initialized // | ||
+ | <code objc>+ (SHSplashScreen *)splashScreenWithTime: | ||
+ | |||
+ | ==== Properties ==== | ||
+ | ---- | ||
+ | === startTransition ==== | ||
+ | The start transition as SHSplashScreenTransition. See [[# | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | SHSplashScreenTransitionFade | ||
+ | === endTransition ==== | ||
+ | The end transition as SHSplashScreenTransition. See [[# | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | SHSplashScreenTransitionFade | ||
+ | === time ==== | ||
+ | The idle time in seconds, which is after the start transition and before the end transition. | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | 2.0f | ||
+ | === startTransitionTime ==== | ||
+ | The start transition time in seconds, which is before the idle time. | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | 0.5f | ||
+ | === endTransitionTime ==== | ||
+ | The end transition time in seconds, which is after the idle time. | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | 0.5f | ||
+ | === skipOnTouch ==== | ||
+ | Indicates if the splash screen will immediately end and be removed from the stage when the stage is touched. | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | NO | ||
+ | === transitionOnTouch ==== | ||
+ | Indicates if the splash screen will begin the end transition when the stage is touched. | ||
+ | <code objc> | ||
+ | **Default Value**\\ | ||
+ | YES\\ | ||
+ | |||
+ | ==== Constants ==== | ||
+ | ---- | ||
+ | === SHSplashScreenTransition ==== | ||
+ | The transition for either the start transition or the end transition. | ||
+ | <code objc> | ||
+ | typedef enum { | ||
+ | SHSplashScreenTransitionFade, | ||
+ | SHSplashScreenTransitionZoom, | ||
+ | SHSplashScreenTransitionSlideUp, | ||
+ | SHSplashScreenTransitionSlideDown, | ||
+ | SHSplashScreenTransitionSlideLeft, | ||
+ | SHSplashScreenTransitionSlideRight, | ||
+ | SHSplashScreenTransitionFadeUp, | ||
+ | SHSplashScreenTransitionFadeDown, | ||
+ | SHSplashScreenTransitionFadeLeft, | ||
+ | SHSplashScreenTransitionFadeRight, | ||
+ | SHSplashScreenTransitionZoomUp, | ||
+ | SHSplashScreenTransitionZoomDown, | ||
+ | SHSplashScreenTransitionZoomLeft, | ||
+ | SHSplashScreenTransitionZoomRight | ||
+ | } SHSplashScreenTransition; | ||
+ | </ | ||
+ | SHSplashScreenTransitionFade | ||
+ | * A fade transition. The start transition will increment the alpha value from 0 to 1.0. The end transition will increment the alpha value from 1.0 to 0. | ||
+ | SHSplashScreenTransitionZoom | ||
+ | * A zoom transition from the center of the screen. The start transition will increment the scale value from 0 to 1.0 and position the splash screen to the center of the screen while transitioning. The end transition will increment the scale value from 1.0 to 0 and position the splash screen to the center of the screen. | ||
+ | SHSplashScreenTransitionSlideUp | ||
+ | * A slide transition in an upwards motion. The start transition will increment the y value from the bottom of the screen to 0. The end transition will increment the y value from 0 to -height. | ||
+ | SHSplashScreenTransitionSlideDown | ||
+ | * A slide transition in a downwards motion. The start transition will increment the y value from the -height to 0. The end transition will increment the y value from 0 to the bottom of the screen. | ||
+ | SHSplashScreenTransitionSlideLeft | ||
+ | * A slide transition in an leftwards motion. The start transition will increment the x value from the far-right of the screen to 0. The end transition will increment the x value from 0 to -width. | ||
+ | SHSplashScreenTransitionSlideRight | ||
+ | * A slide transition in a rightwards motion. The start transition will increment the x value from the -width to 0. The end transition will increment the x value from 0 to the far-right of the screen. | ||
+ | SHSplashScreenTransitionFadeUp | ||
+ | * A slide transition in an upwards motion while fading. The start transition will increment the y value from the bottom of the screen to 0 while incrementing the alpha value from 0 to 1.0. The end transition will increment the y value from 0 to -height while incrementing the alpha value from 1.0 to 0. | ||
+ | SHSplashScreenTransitionFadeDown | ||
+ | * A slide transition in a downwards motion while fading. The start transition will increment the y value from the -height to 0 while incrementing the alpha value from 0 to 1. The end transition will increment the y value from 0 to the bottom of the screen while incrementing the alpha value from 1.0 to 0. | ||
+ | SHSplashScreenTransitionFadeLeft | ||
+ | * A slide transition in an leftwards motion while fading. The start transition will increment the x value from the far-right of the screen to 0 while incrementing the alpha value from 0 to 1.0. The end transition will increment the x value from 0 to -width while incrementing the alpha value from 1.0 to 0. | ||
+ | SHSplashScreenTransitionFadeRight | ||
+ | * A slide transition in a rightwards motion while fading. The start transition will increment the x value from the -width to 0 while incrementing the alpha value from 0 to 1.0. The end transition will increment the x value from 0 to the far-right of the screen while incrementing the alpha value from 1.0 to 0. | ||
+ | SHSplashScreenTransitionZoomUp | ||
+ | * A slide transition in an upwards motion while zooming. The start transition will increment the y value from the bottom of the screen to 0 while scaling from 0 to 1.0. The end transition will increment the y value from 0 to -height while scaling from 1.0 to 0. | ||
+ | SHSplashScreenTransitionZoomDown | ||
+ | * A slide transition in a downwards motion while zooming. The start transition will increment the y value from the -height to 0 while scaling from 0 to 1.0. The end transition will increment the y value from 0 to the bottom of the screen while scaling from 1.0 to 0. | ||
+ | SHSplashScreenTransitionZoomLeft | ||
+ | * A slide transition in an leftwards motion while zooming. The start transition will increment the x value from the far-right of the screen to 0 while scaling from 0 to 1.0. The end transition will increment the x value from 0 to -width while scaling from 1.0 to 0. | ||
+ | SHSplashScreenTransitionZoomRight | ||
+ | * A slide transition in a rightwards motion while zooming. The start transition will increment the x value from the -width to 0 while scaling from 0 to 1.0. The end transition will increment the x value from 0 to the far-right of the screen while scaling from 1.0 to 0. | ||
+ | |||
+ | === SHSplashScreenPhase ==== | ||
+ | The current phase/state of the transitions. | ||
+ | <code objc> | ||
+ | typedef enum { | ||
+ | SHSplashScreenPhaseBegan, | ||
+ | SHSplashScreenPhaseStartTransitionEnded, | ||
+ | SHSplashScreenPhaseEndTransitionBegan, | ||
+ | SHSplashScreenPhaseEnded, | ||
+ | } SHSplashScreenPhase; | ||
+ | </ | ||
+ | SHSplashScreenPhaseBegan | ||
+ | * The splash screen has been added to the stage and began the start transition. | ||
+ | SHSplashScreenPhaseStartTransitionEnded | ||
+ | * The splash screen has completed the start transition and entered the idle state. | ||
+ | SHSplashScreenPhaseEndTransitionBegan | ||
+ | * The splash screen has completed the idle state and began the end transition. | ||
+ | SHSplashScreenPhaseEndTransitionEnded | ||
+ | * The splash screen has completed the end transition and will remove itself from stage. | ||
+ | |||
+ | ==== Events ==== | ||
+ | ---- | ||
+ | === SHSplashScreenEvent === | ||
+ | An event that gets dispatched when entering each // | ||
+ | <code objc> | ||
+ | SHSplashScreen *splashScreen = [SHSplashScreen splashScreen]; | ||
+ | [splashScreen addEventListener: | ||
+ | </ |