0
我想创建一个类似于不碰块的游戏。当我创建块,我希望让雪碧可以init.code是在这里:关于Sprite :: init()在cocos2dx中的错误
#pragma once
#include<iostream>
#include "cocos2d.h"
#include "Block.h"
USING_NS_CC;
Block* CreateWithArgs(Color3B color, Size size, std::string label, float fontsize, Color4B textcolor)
{
auto b = new Block();
b->initWithArgs(color, size, label, fontsize, textcolor);
b->autorelease();
return b;
}
bool initWithArgs(Color3B color, Size size, std::string label, float fontsize, Color4B textcolor)
{
Sprite::init();
return true;
}
但是当我编写这一点,我foud雪碧)错误::初始化(; VS2012告诉我“不要访问保护成员(在cocos2d:雪碧类的声明)”