cocos2d-x 3.0 Button：：create()问题请教大神

eve123
Sun, 11 Oct 2015 16:09:45 +0000

#include “GameScene.h”
#include “cocos2d.h”

#include “extensions/cocos-ext.h”
#include “ui/CocosGUI.h”

USING_NS_CC;

using namespace ui;

Scene* GameScene::createScene()
{
auto scene = Scene::create();
auto layer = GameScene::create();
scene->addChild(layer);
return scene;
}

bool GameScene::init()
{
if (!Layer::init())
{
return false;
}
size = Director::getInstance()->getWinSize();
auto bg = Sprite::create(“farm.jpg”);
bg->setPosition(size.width / 2, size.height / 2);

float sx = size.width / bg->getContentSize().width;
float sy = size.height / bg->getContentSize().height;
bg->setScale(sx, sy);
this->addChild(bg, 0);
//create1();
//setTouchEnabled(true);

mole = Sprite::create("laoshu_4.png");
mole->setPosition(size.width / 2, size.height / 2);

this->addChild(mole);

auto btn = Button::create("cococsui/animationbuttonnormal.png", "cococsui/animationbuttonpressed.png");

return true;

}

void GameScene::touchEvent(Ref* sender, TouchEventType t)
{
}

小白求教。。。。为什么 Button::create 不能接受2个参数？

阅读整个主题