Home Game Development How to resolve this query – C++

How to resolve this query – C++

0
How to resolve this query – C++

[ad_1]

When I exploit the next code, I can see the “node2” sprite after operating this system.

	node2 = Sprite::create("ty.png");
	node2->setPosition(Vec2(700, 600));
	this->addChild(node2,5);
	auto listener = EventListenerKeyboard::create();
	listener->onKeyPressed = [=](cocos2d::EventKeyboard::KeyCode keyCode, Event* occasion) {
		keys[keyCode] = true;
	};
	listener->onKeyReleased = [=](cocos2d::EventKeyboard::KeyCode keyCode, Event* occasion) {
		keys[keyCode] = false;
	};
	_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
	this->scheduleUpdate();

But once I add the next code. I can’t see the “node2” sprite after operating this system.

	auto s = Director::getInstance()->getWinSize();
	auto pFollow = Follow::create(node2, Rect(0, 0, s.width + 3840, s.peak)); 
	node2->runAction(pFollow);

Why?

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here