Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds partial ui::Layout support #155

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

tankorsmash
Copy link
Contributor

@tankorsmash tankorsmash commented Mar 29, 2018

This adds in a Layout and uses the background color from the editor, sort of how it worked in Cocos Studio. The background color use is inconsistent but I'm not sure why, and it doesn't it support the padding/margin and layout options.

You've got to use layout->setBackGroundColorType(cocos2d::ui::Layout::BackGroundColorType::NONE) when it doesn't hide the background properly.

This PR was enough to get my 3.10 Cocos Studio project going.

The python file was removed before I made this PR so it could be pruned I think. Hasn't been updated in years until it was recently removed.

@tankorsmash tankorsmash mentioned this pull request Mar 29, 2018
@drelaptop
Copy link
Contributor

Right, convert_fire_to_json.py is useless for the latest plugin, you can remove it.

it was previously deleted in master
@tankorsmash
Copy link
Contributor Author

I would have but I can't change the file via GH haha. Should be deleted now though!

@drelaptop
Copy link
Contributor

The default Layout Component is created with a Sprite Component, when I try to do a test for this feature, I found it didn't support background image only background color, see:

layout-sprite-pic-lost

Another issue, after remove the default Sprite in Layout, the plugin script will crash when export.

@tankorsmash
Copy link
Contributor Author

tankorsmash commented Mar 29, 2018

@drelaptop I've never used a sprite background for a layout or removed a sprite as a child of a layout (didn't even realize that was possible), but I'll take a look into that and see what needs to be done. Thanks for checking this.

@tankorsmash
Copy link
Contributor Author

tankorsmash commented Mar 29, 2018

@drelaptop So I've got three test cases, a layout whose sprite's spriteframe is empty, a layout whose spriteframe is disabled, and a layout with an enabled sprite with a custom sprite.

I can't reproduce the crash you're seeing but I can see that the sprite isn't being applied to the layout, I can implement some sort of cheat where it leaves the parsed sprite and puts data onto the Layout buffer and sets it that way.

I'll throw the sample layouts into the Scenes folder of the repo that way so there could be some test case like the rest of the assets. I've got them on a personal repo for now since it's got a logo from my own game. Feel free take a look

I'm stepping away for about a week for Easter but I'll take a look afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants