本文整理汇总了C++中LayerColor::initWithColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerColor::initWithColor方法的具体用法?C++ LayerColor::initWithColor怎么用?C++ LayerColor::initWithColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerColor
的用法示例。
在下文中一共展示了LayerColor::initWithColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LayerColor
LayerColor * LayerColor::create(const Color4B& color, GLfloat width, GLfloat height)
{
LayerColor * layer = new LayerColor();
if( layer && layer->initWithColor(color,width,height))
{
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
return nullptr;
}
示例2: new
LayerColor * LayerColor::create(const Color4B& color)
{
LayerColor * layer = new (std::nothrow) LayerColor();
if(layer && layer->initWithColor(color))
{
layer->autorelease();
return layer;
}
CC_SAFE_DELETE(layer);
return nullptr;
}
示例3: init
// on "init" you need to initialize your instance
bool MainLoadingScene::init()
{
if ( !Scene::init() )
{
return false;
}
LayerColor *layer = LayerColor::create();
layer->initWithColor(Color4B(255, 255, 255, 255), VisibleRect::right().x , VisibleRect::top().y);
layer->setPosition(VisibleRect::center());
layer->setAnchorPoint(Vec2(0.5f, 0.5f));
layer->setIgnoreAnchorPointForPosition(false);
this->addChild(layer, 0);
Sprite *fondo = Sprite::create("fondo.png");
fondo->setPosition(VisibleRect::center());
this->addChild(fondo);
Sprite *sprite = Sprite::create("logo.png");
sprite->setPosition(VisibleRect::center());
this->addChild(sprite);
Label *progress = Label::createWithTTF ("Kargatzen ari da.\nMesedez, minutu pare bat itxaron.", "fonts/PT_Sans-Web-Regular.ttf", 10);
progress->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 12));
progress->setAnchorPoint(Vec2(0.5,0.5));
progress->setColor(Color3B(0,0,0));
addChild(progress);
loading = Sprite::create("loading.png");
loading->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + progress->getContentSize().height + loading->getContentSize().height / 2));
addChild(loading);
ActionInterval* rotate = RotateBy::create(5.0f, 360.0f);
RepeatForever *repeat = RepeatForever::create(rotate);
loading->runAction(repeat);
return true;
}