본문 바로가기

카테고리 없음

[cocos2d-x]위치와 관련된 액션(위치)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "HelloWorldScene.h"
 
Scene* HelloWorld::createScene()
{
    auto scene = Scene::create();
    
    auto layer = HelloWorld::create();
    scene->addChild(layer);
 
    return scene;
}
 
bool HelloWorld::init()
{
    if (!Layer::init())
    {
        return false;
    }
 
    auto spr = Sprite::create("ball.png");
    spr->setPosition(Point(100100));
    this->addChild(spr);
 
    auto action = Place::create(Point(200200 ));
    spr->runAction(action);
 
    return true;
}
cs


객체의 위치를 변경해주는 기능 

하지만 실행 했을 때 다른 액션기능과 같이 변화하는 모습을 볼수 없음(위치가 변경된 채로 실행 됨)