#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;
using namespace CocosDenshion;
CCScene* HelloWorld::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
// 'layer' is an autorelease object
HelloWorld *layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
/
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
cocos2d-x学习总结—文字按钮
最新推荐文章于 2018-07-22 16:14:00 发布
本文详细介绍了在cocos2d-x游戏开发中如何创建和使用文字按钮,包括按钮的样式定制、点击事件处理以及在实际场景中的应用技巧,为cocos2d-x开发者提供实战参考。
摘要由CSDN通过智能技术生成