Port of YannickL's CCControlExtensions to cocos2d-x

Where can I find GameState.h?

any missing files should be available https://github.com/jandujar/zatacka-clone-cocos2d-x

solved the references to GameState inside cocos2d-x-extensions

thnak you and your hard woking, i git on the web, https://github.com/jandujar/cocos2d-x-extensions, i saw the source but it doesn’t include the move in state picture! can you give some tips,thanks.

I only copy the source from http://www.cocos2d-x.org/boards/18/topics/7963

I don’t understand your question

Jose Antonio Andujar wrote:

I only copy the source from http://www.cocos2d-x.org/boards/18/topics/7963
>
I don’t understand your question

cool, thanks.

What version of cocos2d-x would the zatacka game be using? (I had trouble building it with 2.1.5).

Also I think to be maximally useful, these extensions should have Lua bindings. Really, the scale9 capability should be built-in to cocos2d-x itself. :slight_smile:

Hi there!

I’ve got a problem with CCControlSwitch from cocos2d-x extension library: mask sprite doesn’t mask anything. Though it works perfect in the samples, but when I use the same code and assets in my project — it fails to draw properly.

I’ve attached a sample of my visual problem (you can see piece of red “off” sprite, which hasn’t been masked).

Any suggestions? Maybe something in environment should be checked?

Recently I’ve found that the point is in cocos2d-x sources version: migration from 2.1 to 2.2.3 has solved the issue.

Guys I use cocos2d-x 3.0. And in there you should use slider as follows:

#include "GUI/CCControlExtension/CCControlExtensions.h"

Also use libExtensions in your project. And here is the code:

cocos2d::extension::ControlSlider* slider = cocos2d::extension::ControlSlider::create(
	"images/buttons/container.png", "images/buttons/progress.png", "images/buttons/knob.png");
slider->setPosition(200, 200);
slider->setMinimumValue(0);
// slider->setSnappingInterval(1);
slider->setMaximumValue(10);
slider->setValue(7);
slider->addTargetWithActionForControlEvents(this, cccontrol_selector(IntroView::valueChangedCallback), cocos2d::extension::Control::EventType::VALUE_CHANGED);
addChild(slider);


void IntroView::valueChangedCallback(Ref* sender, cocos2d::extension::Control::EventType evnt)
{
	float value = static_cast<cocos2d::extension::ControlSlider*>(sender)->getValue();
	CCLOG(std::to_string(value).c_str());
}

The biggest problem here is the slider->setSnappingInterval(1);. There is no setSnappingInterval method. Why it is removed? cocos2d::extension::ControlSlider will not have discrete states any more?