-
Notifications
You must be signed in to change notification settings - Fork 103
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
base: master
Are you sure you want to change the base?
Conversation
…recognize Layout before Sprite
I'm assuming RELATIVE is the same as GRID
Right, |
it was previously deleted in master
I would have but I can't change the file via GH haha. Should be deleted now though! |
@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. |
@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. |
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.