-
Notifications
You must be signed in to change notification settings - Fork 104
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
Layout support #34
Comments
yes, layout support is very important |
Is there a way to list out the limitations of implementing the Layout support, in such a way to maybe get someone else to help implement that? After being parsed by the core/parsers, seems like flatbuffers generates some code, then it goes through it here. I'm not familiar with flatbuffers but the _generated file seems to need input files but I don't know enough to take the next step. Is there a file that is supposed to be fed to flatbuffers that isn't in the repo? Seems like it should be some sort of IDL, but I don't see anything in the repo. Seems like we'd need to
I'm not familiar with much of this but maybe someone else can help guide me |
I will write a doc about how it work, then other developers can join to develop it. |
Great! Looking forward to learning more about how this plugin works. |
@tankorsmash i added this wiki, please let me know if something is missed. And you are appreciated to improve it too. |
@minggo Great thank you! |
https://github.com/tankorsmash/creator_to_cocos2dx/tree/add_layout_support I've started a branch for this. I'll continue to investigate, but I wanted to write progress down as I could use some guidance. I've modified the .fbs, I've added a placeholder Layout.js, I've hooked up the Util.js node guessing to use Layout. The problem I'm running into now is that the cocos2d::ui:Layout* node child isn't being built at all by the getSceneGraph() call, whereas before I started working on this, it would be detected and parsed as a Node. In other words, instead of being parsed incorrectly as Node, it is now not being built at all among the children of the The structure of the scene in my sample project and their names are:
My question is what am I doing wrong that's causing the Layout node, Thanks again for writing the wiki, I've also created an issue where I made a few changes to it too. edit: Realized I missed the convert_fire_to_json, trying that now. edit2: That didn't work and hasn't been edited in about a year, so maybe it's not used anymore. Am now trying to edit CreatorReader.cpp which is looking like that's the piece I missed. |
Did you mean convert_fire_to_json.py? It is not used. I will remove it now. |
Yeah, thanks! |
I've updated CreatorReader.h/.cpp and I've got the nodes generating, I'll update the wiki to make sure that's covered, then add the support for the resizing and I think we'll be cool here, thanks for the help. I'm not familiar with lua, so once I'm done, maybe someone else can come in afterwards and make sure I didn't mess any of that up. |
Cool, waiting your for PR. |
I've got my fork exporting Layouts now, which works well enough for the usecase I was trying to solve, but it doesn't support the padding/magin and layout options. Basically mine just adds in a Layout and uses the background color from the editor, sort of how it worked in Cocos Studio, since I'm unfamiliar with the new stuff. Is that something you're still interested in getting a pull request for? edit: hold on, doesn't seem to support children properly, I'll need to keep working on it. |
The lack of children wasn't a problem in the plugin, I was cloning the widget and since Seems like everything implemented is working as intended. |
Any progress for the Layout? @tankorsmash |
@drelaptop My fork seems to be working, more or less, as of the latest Feb 21st commit. Some weirdness of the sprite background where I still need to set the background fill type to NONE sometimes (most of the time?), but otherwise it was enough for me to port from studio to creator There's the two options that aren't supported, the Resize and Layout types, but I didn't use them in Studio. I didn't want to make a PR because it didnt have that, but I could if the half-baked support would be okay with people, I'll do it. |
This great job is meaningful for plugin users, even though two options not supported, so I suggest you to make a PR, just add comments into that PR what have been supported, what not supported. you can add the unfinished feature if you have free time recently, you don't have to if not. |
@drelaptop Thanks for the thought. Made a PR here that mentions the limitations, hopefully someone else can find a way to use it too. |
No description provided.
The text was updated successfully, but these errors were encountered: