zoukankan      html  css  js  c++  java
  • cocos2d ccitemimage

    #ifndef __HELLOWORLD_SCENE_H__
    #define __HELLOWORLD_SCENE_H__
    
    #include "cocos2d.h"
    
    class HelloWorld : public cocos2d::CCLayer
    {
    public:
    
        virtual bool init();
        static cocos2d::CCScene* scene();
        void menuCloseCallback(CCObject* pSender);
        CREATE_FUNC(HelloWorld);
    };
    
    #endif // __HELLOWORLD_SCENE_H__
    
    
    #include "HelloWorldScene.h"
    
    USING_NS_CC;
    
    CCScene* HelloWorld::scene()
    {
        CCScene *scene = CCScene::create();
        HelloWorld *layer = HelloWorld::create();
        scene->addChild(layer);
        return scene;
    }
    
    bool HelloWorld::init()
    {
        if ( !CCLayer::init() )
        {
            return false;
        }
        
        CCSize winsize = CCDirector::sharedDirector()->getVisibleSize();
    
        CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                            "CloseNormal.png",
                                            "CloseSelected.png",
                                            this,
                                            menu_selector(HelloWorld::menuCloseCallback));
        
    	pCloseItem->setPosition(winsize.width/2,
                                    winsize.height/2);
    
        CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
        pMenu->setPosition(CCPointZero);
        this->addChild(pMenu, 1);
        
        return true;
    }
    
    
    void HelloWorld::menuCloseCallback(CCObject* pSender)
    {
        CCLOG("dianying");
    }
    
    
  • 相关阅读:
    yuv文件并行解析播放
    视频解析
    有意思的并查集讲解 收藏
    C++输入输出重载
    python 同步IO
    多线程与多进程的理解
    centos7 配置redis
    linux中的raid
    form表单系列中文件上传及预览
    centos7 安装swftools Apache_OpenOffice
  • 原文地址:https://www.cnblogs.com/yufenghou/p/5068361.html
Copyright © 2011-2022 走看看