From 64fa90ff0fc2d23db46e1f087ab934dcc3d45ae7 Mon Sep 17 00:00:00 2001 From: Jon Segador Date: Fri, 16 May 2014 16:21:36 +0200 Subject: [PATCH] Vector2 replaced by Vec2 --- .../cpp-template-default/Classes/HelloWorldScene.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index 4ce3b8217d..cea2c2ccfa 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -28,7 +28,7 @@ bool HelloWorld::init() } Size visibleSize = Director::getInstance()->getVisibleSize(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -40,12 +40,12 @@ bool HelloWorld::init() "CloseSelected.png", CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); - closeItem->setPosition(Vector2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , + closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , origin.y + closeItem->getContentSize().height/2)); // create menu, it's an autorelease object auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Vector2::ZERO); + menu->setPosition(Vec2::ZERO); this->addChild(menu, 1); ///////////////////////////// @@ -57,7 +57,7 @@ bool HelloWorld::init() auto label = LabelTTF::create("Hello World", "Arial", 24); // position the label on the center of the screen - label->setPosition(Vector2(origin.x + visibleSize.width/2, + label->setPosition(Vec2(origin.x + visibleSize.width/2, origin.y + visibleSize.height - label->getContentSize().height)); // add the label as a child to this layer @@ -67,7 +67,7 @@ bool HelloWorld::init() auto sprite = Sprite::create("HelloWorld.png"); // position the sprite on the center of the screen - sprite->setPosition(Vector2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); + sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); // add the sprite as a child to this layer this->addChild(sprite, 0);