{"id":401,"date":"2014-09-15T00:41:46","date_gmt":"2014-09-15T09:41:46","guid":{"rendered":"http:\/\/blog.box.kr\/?p=401"},"modified":"2014-09-15T00:41:46","modified_gmt":"2014-09-15T09:41:46","slug":"%ed%8e%8ccocos2d-x-3-0-alpha1-hello-world-h","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=401","title":{"rendered":"[\ud38c][Cocos2d-x] 3.0 Alpha1 &#8211; Hello World.h"},"content":{"rendered":"<p><a href=\"http:\/\/singleton.tistory.com\/348\">http:\/\/singleton.tistory.com\/348<\/a><\/p>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"td_body\">\n<table border=\"0\" width=\"750\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td><\/td>\n<td class=\"td_bodyt\">&nbsp;\n<p><a href=\"http:\/\/singleton.tistory.com\/348\"><span class=\"head_title\">[Cocos2d-x] 3.0 Alpha1 &#8211; Hello World.h<\/span><\/a><span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\n<a class=\"gbtn_kor\" href=\"http:\/\/singleton.tistory.com\/category\/%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8\/Cocos2d-x\">\ud504\ub85c\uc81d\ud2b8\/Cocos2d-x<\/a><span class=\"Apple-converted-space\">\u00a0<\/span>| 2013\/12\/07 20:09<\/td>\n<td class=\"td_body\" align=\"right\"><\/td>\n<td class=\"td_body\">\n<table border=\"0\" width=\"750\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div class=\"tt_article_useless_p_margin\">\u00a0<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\n\u203b python\uc758 create_project\ub85c \uc0dd\uc131\ud55c \uc0d8\ud50c \ud504\ub85c\uc81d\ud2b8\uc5d0 \ub300\ud55c \uae00\uc785\ub2c8\ub2e4.#ifndef __HELLOWORLD_SCENE_H__<br \/>\n#define __HELLOWORLD_SCENE_H__\/\/ cocos2d \ucf54\ub4dc\ub97c \uc4f0\uae30 \uc704\ud55c \uc778\ud074\ub8e8\ub4dc<br \/>\n#include &#8220;cocos2d.h&#8221;<\/p>\n<p>class HelloWorld : public cocos2d::Layer<br \/>\n{<br \/>\npublic:<br \/>\n\/\/ there&#8217;s no &#8216;id&#8217; in cpp, so we recommend returning the class instance pointer<br \/>\n\/\/ cpp\uc5d0\ub294 &#8216;id&#8217;\uac00 \uc5c6\uc73c\ubbc0\ub85c \ud3ec\uc778\ud130\ub97c \ub9ac\ud134\ud558\ub294 \uac83\uc744 \ucd94\ucc9c\ud569\ub2c8\ub2e4 (cocos-iphone Object-C\ub97c \uc0ac\uc6a9)<\/p>\n<p>static cocos2d::Scene* createScene();<\/p>\n<p>\/\/ Here&#8217;s a difference. Method &#8216;init&#8217; in cocos2d-x returns bool, instead of returning &#8216;id&#8217; in\u00a0 cocos2d-iphone<\/p>\n<p>\/*<br \/>\n* N.B.: CCNode\uc758 init() \uba54\uc18c\ub4dc\ub97c \uc7ac\uc815\uc758\ud569\ub2c8\ub2e4. init() \uba54\uc18c\ub4dc\ub97c \uc7ac\uc815\uc758\ud574\uc918\uc57c \ud558\ub294 \uc774\uc720\ub294,<br \/>\n* create() \uba54\uc18c\ub4dc\ub97c \uc0ac\uc6a9\ud574 \uac1d\uccb4\ub97c \uc0dd\uc131\ud560 \ub54c init() \uba54\uc18c\ub4dc\ub97c \ubd80\ub974\uac8c \uad6c\ud604\ub418\uc5b4 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.<br \/>\n* (\uc774 \ud5e4\ub354 \uc544\ub798\ucabd\uc5d0 \uc788\ub294 CREATE_FUNC\uc758 \uc120\uc5b8\uc744 \ub530\ub77c\uac00\ubcf4\uba74 create() \uba54\uc18c\ub4dc\uc758 \uad6c\ud604\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.)<br \/>\n* \ub530\ub77c\uc11c HelloWorld::create() \uc2dd\uc758 \uad6c\ubb38\uc744 \uc0ac\uc6a9\ud574 \uac1d\uccb4\ub97c \uc0dd\uc131\ud558\ub824\uba74, init() \uba54\uc18c\ub4dc\ub97c \uad6c\ud604\ud574\uc11c \uac1d\uccb4\ub97c \ucd08\uae30\ud654\ud560 \uc218 \uc788\uac8c \ud574\uc918\uc57c\ud569\ub2c8\ub2e4.<br \/>\n*\/<\/p>\n<p>virtual bool init();<\/p>\n<p>\/\/ a selector callback<\/p>\n<p>\/*<br \/>\n* cocos2d-x\uc5d0\uc11c CCMenu\ub97c \uc0ac\uc6a9\ud558\uc5ec \uba54\ub274\ub97c \ub9cc\ub4e4\uc5c8\uc744 \ub54c, \ud074\ub9ad(\ud130\uce58)\uc5d0 \ub300\ud55c \ucf5c\ubc31\ud568\uc218 \uc785\ub2c8\ub2e4.<br \/>\n* CCMenu\ub97c \ub9cc\ub4e4\uace0, \uadf8 \uc548\uc5d0 \uba54\ub274 \uc544\uc774\ud15c\uc73c\ub85c CCMenuItemImage, CCMenuItemSprite, CCMenuItemToggle \ub4f1\uc774 \ucd94\uac00\ub418\ub294\ub370<br \/>\n* \uba54\ub274\ub97c \ud130\uce58\ud558\uba74 \uadf8 MenuItem\uc774 \uc778\uc790\uac12\uc73c\ub85c \ub118\uc5b4\uc624\uac8c \ub429\ub2c8\ub2e4.<br \/>\n* \uc5b4\ucc28\ud53c \ubaa8\ub450\uac00 CCObject\uc758 Derived Class\uc774\ubbc0\ub85c, \ud615\ubcc0\ud658 \ud6c4 \ucc98\ub9ac\ud558\uc2dc\uba74 \ub429\ub2c8\ub2e4.(\ud544\uc694\ud558\ub2e4\uba74)<br \/>\n*\/<br \/>\nvoid menuCloseCallback(Object* pSender);<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>\/\/ implement the &#8220;static create()&#8221; method manually<br \/>\n\/\/ HelloWorld::create() \uc774 \uac00\ub2a5\ud558\uac8c \ud574\uc900\ub2e4. \ucc38\uace0\ub85c create()\uc73c\ub85c \uac1d\uccb4\ub97c \uc0dd\uc131\ud558\uba74 Cocos\uc758autorelease pool\uc5d0 \ub4f1\ub85d\ud574\uc900\ub2e4.<\/p>\n<p>CREATE_FUNC(HelloWorld);<\/p>\n<p>};<\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/singleton.tistory.com\/348 &nbsp; [Cocos2d-x] 3.0 Alpha1 &#8211; Hello World.h\u00a0 \ud504\ub85c\uc81d\ud2b8\/Cocos2d-x\u00a0| 2013\/12\/07 20:09 \u00a0\u00a0 \u203b python\uc758 create_project\ub85c \uc0dd\uc131\ud55c \uc0d8\ud50c \ud504\ub85c\uc81d\ud2b8\uc5d0 \ub300\ud55c \uae00\uc785\ub2c8\ub2e4.#ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__\/\/ cocos2d \ucf54\ub4dc\ub97c \uc4f0\uae30 \uc704\ud55c \uc778\ud074\ub8e8\ub4dc #include &#8220;cocos2d.h&#8221; class HelloWorld : public cocos2d::Layer { public: \/\/ there&#8217;s no &#8216;id&#8217; in cpp, so we recommend returning the class instance pointer \/\/ cpp\uc5d0\ub294 &#8216;id&#8217;\uac00 \uc5c6\uc73c\ubbc0\ub85c \ud3ec\uc778\ud130\ub97c \ub9ac\ud134\ud558\ub294 \uac83\uc744 \ucd94\ucc9c\ud569\ub2c8\ub2e4 (cocos-iphone Object-C\ub97c \uc0ac\uc6a9) static cocos2d::Scene* createScene(); \/\/ Here&#8217;s a difference. Method &#8216;init&#8217; in cocos2d-x returns bool, instead of returning &#8216;id&#8217; in\u00a0 cocos2d-iphone \/* * N.B.: CCNode\uc758 init() \uba54\uc18c\ub4dc\ub97c \uc7ac\uc815\uc758\ud569\ub2c8\ub2e4. init() \uba54\uc18c\ub4dc\ub97c \uc7ac\uc815\uc758\ud574\uc918\uc57c \ud558\ub294 \uc774\uc720\ub294, * create() \uba54\uc18c\ub4dc\ub97c \uc0ac\uc6a9\ud574 \uac1d\uccb4\ub97c \uc0dd\uc131\ud560 \ub54c init() \uba54\uc18c\ub4dc\ub97c \ubd80\ub974\uac8c \uad6c\ud604\ub418\uc5b4 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4. * (\uc774 \ud5e4\ub354 \uc544\ub798\ucabd\uc5d0 \uc788\ub294 CREATE_FUNC\uc758 \uc120\uc5b8\uc744 \ub530\ub77c\uac00\ubcf4\uba74 create() \uba54\uc18c\ub4dc\uc758 \uad6c\ud604\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.) * \ub530\ub77c\uc11c HelloWorld::create() \uc2dd\uc758 \uad6c\ubb38\uc744 \uc0ac\uc6a9\ud574 \uac1d\uccb4\ub97c \uc0dd\uc131\ud558\ub824\uba74, init() \uba54\uc18c\ub4dc\ub97c \uad6c\ud604\ud574\uc11c \uac1d\uccb4\ub97c \ucd08\uae30\ud654\ud560 \uc218 \uc788\uac8c \ud574\uc918\uc57c\ud569\ub2c8\ub2e4. *\/ virtual bool init(); \/\/ a selector callback \/* * cocos2d-x\uc5d0\uc11c CCMenu\ub97c \uc0ac\uc6a9\ud558\uc5ec \uba54\ub274\ub97c \ub9cc\ub4e4\uc5c8\uc744 \ub54c, \ud074\ub9ad(\ud130\uce58)\uc5d0 \ub300\ud55c \ucf5c\ubc31\ud568\uc218 \uc785\ub2c8\ub2e4. * CCMenu\ub97c \ub9cc\ub4e4\uace0, \uadf8 \uc548\uc5d0 \uba54\ub274 \uc544\uc774\ud15c\uc73c\ub85c CCMenuItemImage, CCMenuItemSprite, CCMenuItemToggle \ub4f1\uc774 \ucd94\uac00\ub418\ub294\ub370 * \uba54\ub274\ub97c \ud130\uce58\ud558\uba74 \uadf8 MenuItem\uc774 \uc778\uc790\uac12\uc73c\ub85c \ub118\uc5b4\uc624\uac8c \ub429\ub2c8\ub2e4. * \uc5b4\ucc28\ud53c \ubaa8\ub450\uac00 CCObject\uc758 Derived Class\uc774\ubbc0\ub85c, \ud615\ubcc0\ud658 \ud6c4 \ucc98\ub9ac\ud558\uc2dc\uba74 \ub429\ub2c8\ub2e4.(\ud544\uc694\ud558\ub2e4\uba74) *\/ void menuCloseCallback(Object* pSender);\u00a0 \/\/ implement the &#8220;static create()&#8221; method manually \/\/ HelloWorld::create() \uc774 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[6],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-6t","jetpack-related-posts":[{"id":160,"url":"https:\/\/blog.box.kr\/?p=160","url_meta":{"origin":401,"position":0},"title":"\ubcfc \ucc45..","date":"2014-07-06","format":false,"excerpt":"http:\/\/www.yes24.com\/24\/goods\/13212007?scode=032&OzSrank=1 (Cocos2d-x 3 \ubaa8\ubc14\uc77c \uac8c\uc784 \ud504\ub85c\uadf8\ub798\ubc0d) \u00a0 \u00a0 http:\/\/www.yes24.com\/24\/goods\/13251482?scode=029 (\u00a0\uc608\uc81c \uc911\uc2ec\uc758 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc744 \uc704\ud55c\u00a0Qt5 \ud504\ub85c\uadf8\ub798\ubc0d \uac00\uc774\ub4dc\u00a0) \u00a0","rel":"","context":"In &quot;\ucc45&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":232,"url":"https:\/\/blog.box.kr\/?p=232","url_meta":{"origin":401,"position":1},"title":"\uc720\ub2c8\ud2f03D\uad00\ub828 URL","date":"2014-07-23","format":false,"excerpt":"http:\/\/ncanis.tistory.com\/category\/C%23\/Unity3d%20%EA%B2%8C%EC%9E%84%20%EC%97%94%EC%A7%84","rel":"","context":"In &quot;UNITY3D\/COCOS2D&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":594,"url":"https:\/\/blog.box.kr\/?p=594","url_meta":{"origin":401,"position":2},"title":"UNITY \ub2e4\uc911 \ud574\uc0c1\ub3c4 \ube44\uc728 \uace0\uc815 \uce74\uba54\ub77c","date":"2015-01-30","format":false,"excerpt":"2d \ubaa8\ubc14\uc77c \uac8c\uc784 \ub9cc\ub4e4\ub54c \uc720\uc6a9\ud55c \uc2a4\ud06c\ub9bd\ud2b8 \uce74\uba54\ub77c\uc5d0 \ubd99\uc5ec\uc11c \uc0ac\uc6a9 \ucd1d 6 \ubaa8\ub4dc \uc804\ubd80 \ubcf4\uc5ec\uc8fc\uae30, \uc88c\uc6b0\ube44\uc728 \ub9de\ucd94\uae30, \uac00\ub85c \uace0\uc815, \uc138\ub85c \uace0\uc815, \uc5ec\ubc31 \uc5c6\uc74c, \ub298\ub9ac\uae30 Link \u00a0 https:\/\/gist.github.com\/howlryu\/6bf4305c96f7dda4a3f4","rel":"","context":"In &quot;UNITY3D\/COCOS2D&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":541,"url":"https:\/\/blog.box.kr\/?p=541","url_meta":{"origin":401,"position":3},"title":"[\uc624\ub958\ub300\ucc98]Unity3D Android Build Error WIN32 Exception ZipAlign","date":"2015-01-06","format":false,"excerpt":"Unity3D\uc5d0\uc11c Android Build \ud560\ub54c \uc624\ub958..\ub0b4\uc5ed Error building Player: Win32Exception: ApplicationName='...\/...\/...\/...\/adt-bundle-mac-x86_64-20140624\/sdk\/tools\/zipalign', CommandLine='4\"\/...\/...\/...\/...\/Asteroid2(2)\/Temp\/StagingArea\/Package.apk'\". CurrentDirectory='Temp\/StagingArea' \u00a0 \ud574\uacb0\ucc45.. Find your copy of the Android SDK in explorer Go to build-tools and choose a version (e.g.build-tools19.1.0) Copy zipalign.exe Come back out of build-tools Go into tools Paste zipalign.exe","rel":"","context":"In &quot;UNITY3D\/COCOS2D&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":588,"url":"https:\/\/blog.box.kr\/?p=588","url_meta":{"origin":401,"position":4},"title":"Unity3D Android Build Error WIN32 Exception ZipAlign","date":"2015-01-30","format":false,"excerpt":"UNITY3D\uc5d0\uc11c Android Build \ud560\ub54c \uc774\ub7f0 \uc624\ub958\uac00 \ubc1c\uc0dd.. Error building Player: Win32Exception: ApplicationName='...\/...\/...\/...\/adt-bundle-mac-x86_64-20140624\/sdk\/tools\/zipalign', CommandLine='4\"\/...\/...\/...\/...\/Asteroid2(2)\/Temp\/StagingArea\/Package.apk'\". CurrentDirectory='Temp\/StagingArea' \ub0b4\uc6a9\uc778 \uc989\uc740 \ud574\ub2f9 \uacbd\ub85c\uc5d0 \"zipalign.exe\"\uac00 \uc5c6\ub2e4\ub294 \uc598\uae30.. \uadf8\ub798\uc11c \uc544\ub798\uc640 \uac19\uc774 \ucc98\ub9ac \ud558\uba74 \ub428.. Android SDK \ub514\ub809\ud1a0\ub9ac\ub97c \ud655\uc778 \ubc84\uc804\uc5d0 \ub9de\ub294 build-tools \ub514\ub809\ud1a0\ub9ac\ub85c \uc774\ub3d9\u00a0(e.g.build-tools19.1.0) zipalign.exe \ud654\uc77c\uc744 \ubcf5\uc0ac build-tools \ub514\ub809\ud1a0\ub9ac\ub97c \ub098\uc640\uc11c\u00a0tools \ub514\ub809\ud1a0\ub9ac\ub85c \uc774\ub3d9 \ud6c4 \ubcf5\uc0ac \u00a0 \uc774\uc0c1..","rel":"","context":"In &quot;UNITY3D\/COCOS2D&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":398,"url":"https:\/\/blog.box.kr\/?p=398","url_meta":{"origin":401,"position":5},"title":"[\ud38c][cocos2d-x] 1. \uc2dc\uc791\ubd80\ud130 \ub4dc\ub7fd\uac8c \uc5b4\ub835\ub124","date":"2014-09-15","format":false,"excerpt":"http:\/\/mightyfine.egloos.com\/278662 [cocos2d-x] 1. \uc2dc\uc791\ubd80\ud130 \ub4dc\ub7fd\uac8c \uc5b4\ub835\ub124\u00a0\ub4dc\ub7fd\uac8c \uc5b4\ub824\uc6b4 cocos2d-x by\u00a0\ud798\uc138\uace0\uac15\ud55c\uc648\ub3c4\u00a0 2013\/12\/17 01:24\u00a0 mightyfine.egloos.com\/278662\u00a0 \ub367\uae00\uc218 :\u00a011 2.2.1 \ubc84\uc804\uc784 \ub0b4\uac00 \uc544\ubb34\ub9ac \ucd08\uc9dc \ud504\ub85c\uadf8\ub798\uba38\ub77c\uace0\ub294 \ud558\uc9c0\ub9cc, \ucf54\ucf54\uc2a42DX\uc758 \uc124\uce58\uc640 \ud504\ub85c\uc81d\ud2b8 \uc0dd\uc131\uc740 \uc815\ub9d0 \ub108\ubb34\ud558\ub2e4 \uc2f6\uc744 \uc815\ub3c4\ub85c \uc5b4\ub835\ub2e4. \uc548\ub4dc\ub85c\uc774\ub4dc \uac1c\ubc1c \uc5b4\uca4c\uad6c \ud558\uc9c0\ub9cc \uc774\uac70\uc5d0 \ube44\ud558\uba74 \uc9c0\uc0c1\ub77d\uc6d0\uc774\uc9c0. \ub098\ub294 \uad6c\uae00\uc758 \uc2e0\ubd09\uc790\uc778\ub370, \uad6c\uae00\ub9c1\uacfc \uc720\ud29c\ube0c\uac00 \uc5c6\uc5c8\ub2e4\uba74 \uc544\ub9c8 \uc9c0\uae08 \ub9cc\ud07c\uc758 \uc2e4\ub825\uc870\ucc28\ub3c4 \uac16\ucd9c \uc218 \uc5c6\uc5c8\uc744\u2026","rel":"","context":"In &quot;\ucc38\uace0\ub97c \uc704\ud55c \uc800\uc7a5\ubb3c&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pds27.egloos.com\/pds\/201312\/16\/10\/f0271810_52af12d680617.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/401"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=401"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/401\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}