I'm new in c++ and I am working some stuff with cocos2d-x
I wanted to create just a simple Size property in the .h file to use in the implementation along different methods keeping its state.
what am I missing here?
#ifndef __INTROBETTER_SCENE_H__
#define __INTROBETTER_SCENE_H__
#include "cocos2d.h"
class IntroBetterScene : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
// implement the "static create()" method manually
CREATE_FUNC(IntroBetterScene);
private:
void GoToMainMenuScene(float dt);
Size* sizeWindow;
};
#endif //__INTROBETTER_SCENE_H__
Because you did not specify the correct scope. There is no class Size
in the current scope. You need to use cocos2d::Size
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.