C++ and Lua support for creator alpha1 released

Hi @zhangxm, I have encountered issues with the positions when loading the ui in cocos2dx from the exported files.
Some of the positions look desirable, while some do not.

fire_-2017-08-28 10_33_46
How it looks like in Cocos Creator.

GameCloud-2017-08-28 10_35_10
How it looks like in Cocos2dx

Will you please send me the creator project to reproduce it?
Thanks.

@zhangxm ok have sent you the link~

@Darren_86 i sent the PR to fix it: https://github.com/cocos2d/creator_to_cocos2dx/pull/92. I met problem when parsing your scene, back ground image missed in EditBox, it is needed in cocos2d-x. I think you can use an transparent image to fix it.

And i find your project doesnā€™t have design resolution setting, i suggest adding a Canvas node as the root of Scene.

@zhangxm thank you for the fix!
ah yes i have missed out sending to you the back ground image and also for the EditBox iā€™ve modified the parser to allow no image and i create it in the reader code instead.

Indeed after iā€™ve added the Canvas node, the positions of all the items now look exactly like it is in the Creator. Except for the labels in the icons at the right hand side - their positions appear to be lower than how it is in Creator.

Did you modify engine too? Or could you please share me how you make it work?

Maybe it is something with the PR i sent? I tested in other scenes, havenā€™t found it. Could you please share a creator project too? Thanks.

Basically in CreatorReader::createEditBox i just hard-coded the sprite to be used for the EditBox creation.

cocos2d::ui::Scale9Sprite* sprite = cocos2d::ui::Scale9Sprite::create(ā€œUI/ui_retangle_cruved_transparent.pngā€);
sprite->setOpacity(0);
auto editBox = ui::EditBox::create(cocos2d::Size(contentSize->w(), contentSize->h()), sprite);

And iā€™ve just sent you the project now with the canvas.

Got it. You can set the background in plugin, it is more convenient. I have to handle v3.16 releasing these days, so i will look at the issue later.

Somethingā€™s wrong with design resolutionā€¦
Iā€™ve created an empty project with default Canvas settings (960x640 design resolution, Fit Height) and then Iā€™ve added a simple background (1136x768) inside it.
In editor it looks like this:

Now, in settings Iā€™ve set Simulator Resolution to iPhone 5 (1136x640) and they ran it:

Looking fine, we can see centered image and extended viewport on both sides, because iPhone5 (1136x640) is wider than design resolution (960x640).

Now, Iā€™m trying to run the same thing from cocos2d-x project. Iā€™ve removed all default design resolution code.

Scene* HelloWorld::createScene()
{
    creator::CreatorReader* reader = creator::CreatorReader::createWithFilename("creator/scene1.ccreator");
    
    // will create the needed spritesheets + design resolution
    reader->setup();
    
    // get the scene graph
    Scene* scene = reader->getSceneGraph();
    
    return scene;
}

That gave me this result on iPhone 5 simulator:

Iā€™ve even tried replacing setup() code with this:

void CreatorReader::setup()
{
    auto director = cocos2d::Director::getInstance();
    auto glview = director->getOpenGLView();
    
    glview->setDesignResolutionSize(960, 640, ResolutionPolicy::FIXED_HEIGHT);

    setupSpriteFrames();
    setupCollisionMatrix();
}

and got this result:

Whatā€™s wrong?

@zhangxm can you take a look?

@piotrros sorry, i can not see the picture, it seems there is an issue of the forum. I have reported the issue to forum maintainer.
@slackmoehrle do you know the reason?

@piotrros i tried to update a picture, there is not problem, i can see it. Could you please send me the picture you uploaded? We are curious if it is something related with the picture.
Thanks.

Here you go:

I will look at why.

@piotrros what format were your images in?

Itā€™s a JPEG 1136x768 pixels.

@piotrros i can see this file, but i can not see it in your above post, it is strange, could you please modify your above post to upload the pictures again? Thanks.

Iā€™ve edited my post, please take a look.

@piotrros thanks.

@piotrros could you please provide a creator project to reproduce it?