Monday, June 27, 2022
HomeGame DevelopmentClass has no member "setTouchEnabled" - C++

Class has no member “setTouchEnabled” – C++


Im utilizing cocos2d-x v4.0
is “setTouchEnabled and setTouchMode” been eliminated?

Right here’s my code:

bool Joystick::init()
{
	if (!Layer::init())
		return false;


	_winSize = Director::getInstance()->getWinSize();

	_isTouch = false;

	// velocity
	_speed = 0.1;

	// contact present
	_isTouchShow = false;

	// restrict win measurement
	_isLimmitWinSize = false;

	// Joystick - Commonplace Place
	centerPos = Vec2(125, 125);

	// Joystick - Again Sprite (Restrict)
	joystick_limit = Sprite::create("joystick_limit_circle.png");
	joystick_limit->setPosition(centerPos);
	this->addChild(joystick_limit);


	// Joystick - Entrance Sprite (Controler)
	joystick_control = Sprite::create("joystick_control_circle.png");
	joystick_control->setPosition(centerPos);
	this->addChild(joystick_control);

	// Joystick - Controler Place
	controlerPos = centerPos;

	// Contact Enabled
	this->setTouchEnabled(true);
        this->setTouchMode(Contact::DispatchMode::ALL_AT_ONCE);

	// setSchedule Replace
	cocos2d::Director::getInstance()->getScheduler()->schedule(
		std::bind(&Joystick::replace, this, std::placeholders::_1),
		this, 1 / 60.f, false, "JoyStickUpdate");

	return true;
}

if its been eliminated what ought to i exploit as a substitute of setTouchEnable and setTouchMode???


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments