ios - How can I create a pop-up window using Cocos2d, SpriteBuilder and Objective-c? -


so i'm trying this:

http://blog.typpz.com/2013/12/09/ios-sdk-create-a-pop-up-window/

but since not using spritekit can't use exact method. imagine there should way create same pop window effect using sprite builders layer option maybe? animating using of ccaction methods exist. im not sure though , don't know how go figuring out.

any appreciated.

a simple way create cclayer, said, , animate it.

once you've created cclayer size of "popup" want, , added whatever want put in it, can start animating it.

if want similar effect animation in tutorial linked, best way use combination of ccactionfadein , ccactionscaleto. conveniently, spritebuilder's animation set has both of these use, , can set keyframe animation within spritebuilder without code. (make sure name animation sequence can remember since you'll need refer when start coding - i'd call "popupanimation", or that.)

once you've finished doing that, have call animation code. example, if have ccbutton selector "showpopup", do:

func showpopup() {     self.animationmanager.runanimationsforsequencenamed("popupanimation") } 

assuming you've done right, popup appear! you're stuck popup on screen, , no way out.

to fix this, make animation sequence (i'll call "removepopup") remove popup screen. add button cclayer, , set selector "hidepopup". code, can run:

func hidepopup() {     self.animationmanager.runanimationsforsequencenamed("removepopup") } 

and have "popup" window can animate!


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -