Cocos Studio 2 Feedback

As the others already posted, this is cause you are using the event listener of the widget, which listens on all type of events. It’s like the event handlers for armatures/animations(setFrameEventCallFunc and setMovementEventCallFunc). Those bundle all events in the same callback and have to be filtered by the event type. They work similar to the windows messsage loop.

If you want to implement a specific event, you can use the addEventListenerWithSceneGraphPriority method of the _eventDispatcher. It implements specific callbacks for every event type. This can be also used with widgets(in your case a button), because the widgets are derived from Node and the _eventDispatcher works on Nodes.

HI!
how I can add ability to sprite or node animate visibilty?
now there only rotation, scale and position properties present on time as sub-items of sprite.
I know it possible, because it present for example:


but If I add new sprite there no ability to animate “visible”:

I tryed set visibility for “K” frames but it does not help.

Please help me, it driving me crazy)

1 Like

hey!
I found the way to add “visible” property to animation.
it need check “automatic frame recording” and check and uncheck visibility in different frames.
A bit unobiously through.

And THAT IS AWESOME TOOL!

Hi, I don’t know is it a bug, or an intended behaviour of cocostudio.

First, create the canvas with 640960, and then put a sprite with 6401136 dimension right at the middle (320, 480)
the sprite will have excess in height both in the upper and lower side.

but if you load the cocostudio file in cocos2d-x, and start the iphone 5s simulator (which had 1136 resolution in height), the upper side will be black. how can i achieve what i wanted?

I am not sure this the intended behaviour of cocostudio, but you can achieve the desired result by this

auto rootNode = CSLoader::createNode( "MainScene.csb" );
rootNode->setPositionY(960 - Director::getInstance()->getVisibleSize().height);
addChild( rootNode );

How to succesfully import UI from CocosBuilder?

Thanks @IQD

@sortris -

// bring in the main scene from cocos studio
    rootNode = CSLoader::createNode("GameScene.csb");
    rootNode->setName("rootNode");
    addChild(rootNode);
    
    // setup animationtime-line and run what's on it
    auto action = CSLoader::createTimeline("GameScene.csb");
    rootNode->runAction(action);
    action->gotoFrameAndPlay(0, true);

ttf is not working :frowning:

When I try to declare this in my header it doesn’t like Widget::TouchEventType

Maybe his code relies on namespace scopes utilizing using.

You have to use:

#include <ui/UIWidget.h>

and the full namespace: ui::Widget::TouchEventType

If you want to copy&paste his code, you have to scope the root namespace: using namespace ui.
After that, you can use Widget::TouchEventType.

Yes, I for some reason was trying to do cocos2d::ui::Widget which I thought would work.

Consider:

.h

void menuStartCallback(Ref* pSender, cocos2d::ui::Widget::TouchEventType type);

.cpp

using namespace ui;
....
void HelloWorld::menuStartCallback(Ref* pSender, Widget::TouchEventType type)
{
    switch (type)
    {
        case Widget::TouchEventType::BEGAN:
            std::cout << "pressed the start button" << std::endl;
            auto director = Director::getInstance();
            director->replaceScene(GameScene::createScene());
            break;
            
        case Widget::TouchEventType::ENDED:
            
            break;
            
        default:
            break;
    }
}

I’m getting an incomplete type in the header

I’ve encountered a bug:

I had manually installed ant, adt-bundle, etc manually, and was using cocos console just fine.

Then I installed CocoStudio2, tried it out and decided to uninstall for the moment, and now cocos-console won’t work anymoe.

I’ve tried re-setting up everything, but I keep on getting errors.

For example, if I try todo a cocos compile -p web -m release, I get the following:

Running command: compile
Building mode: release
running: 'C:\ant\bin\ant -f E:\eclipseworkspaces\cocosws\Titos\publish\html5\bui
ld.xml'

Buildfile: E:\eclipseworkspaces\cocosws\Titos\publish\html5\build.xml

BUILD FAILED
E:\eclipseworkspaces\cocosws\Titos\publish\html5\build.xml:5: java.lang.Unsuppor
tedClassVersionError: com/google/javascript/jscomp/ant/CompileTask : Unsupported
 major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoade
r.java:1128)
        at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader
.java:1299)
        at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa
der.java:1354)
        at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:131
5)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:106
8)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:249)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:579)

        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:237)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
179)
        at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:93)
        at org.apache.tools.ant.Main.runBuild(Main.java:826)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 0 seconds
Error running command, return code: 1

Any clues?

add this in header file

#include “cocostudio/CocoStudio.h”

Thanks for your advice, but I didn’t mean CocosStudio but CocosBuilder…

Is armature going to be supported in the feature?
I have some objects that extends Armature…so CocoStudio 2 working with Node*… Do i need to move from armature to animated node in cocostudio 2?

Thnx…

is OS X 10.8.4 supported?
Displays “Failed To Init GameWindow” error when trying to open a scene.

I’m experiencing a possible bug with Cocos Studio: When I try to publish my Cocos Studio scenes and contents to Xcode…nothing happens. No errors, no hang up. It opens Xcode, creates the project, but it doesn’t publish any of the content I’ve designed in Cocos Studio. Is somebody experiencing the same issue? (Or does somebody know why this is happening to me?)
Thx guys.

PS_ I use Cocos Studio 2.02 and Cocos 2d-x 3.3 + xcode 6.1

How can I achieve flexible size of root node(Panel) in cocostudio 2.0.2, like Adaptive Resoultion in cocostudio 1.6?

and I could not find ListView

I can’t use Relative percentage of parent container :frowning:

I want to use relative position and size, too.

1 Like