-
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
export Creator Widget component to Cocos2d-x Layout Node #160
Open
drelaptop
wants to merge
36
commits into
cocos2d:master
Choose a base branch
from
drelaptop:export-widget-to-layout
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+625
−7
Open
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
aa83e85
fix Animation reverse not effect
drelaptop 15b7f05
fix loop reverse bug
drelaptop 6e6e7c0
remove a while not needed
drelaptop 1b44b7c
PingPong is a Loop mode
drelaptop 4e87cbe
add comment
drelaptop 62b5f58
add export option
drelaptop 84c03d3
add js logic to copy dynamic res
drelaptop d4be795
improve var name
drelaptop 6827e85
roolback unrelated changes
drelaptop ed809fa
improve UI/var name
drelaptop cbe246a
improve mod method
drelaptop 23eb44f
remove useless duration twice
drelaptop 449c242
fix loop animate memory leak
drelaptop a59da3b
Merge branch 'root-master' into fix-animation-wrapmode
drelaptop ba726bc
fix PlayOnLoad loop animation leaks
drelaptop cdb4ca8
Merge branch 'export_all_resources' into export-widget-to-layout
drelaptop f68eab8
Merge branch 'fix-animation-wrapmode' into export-widget-to-layout
drelaptop 914d731
init add widget components
drelaptop 8943712
widget property collect
drelaptop f88de5f
add necessary flatbuffer info
drelaptop 32a1b47
init cpp to support widget
drelaptop 2697f40
change the adapt way, add WidgetAdapter class
drelaptop ce7b6ea
add widget adapter
drelaptop c0b32d5
linear layout effect wrong
drelaptop ecc726f
change to relative layout, correct
drelaptop f2a70b7
add widget manager, run fail
drelaptop dcc88d2
correct WidgetManager
drelaptop 48c4830
add comments
drelaptop d60dd67
add widget release
drelaptop 042ef74
Merge remote-tracking branch 'root/master' into export-widget-to-layout
drelaptop 2b0e0ac
update comments
drelaptop 1b1aee1
support 9 align size comb
drelaptop 1ceed70
support 9 auto align in node
Kuovane 975fc03
support auto align in node if it add widget in creator .
drelaptop 5acd01c
improve widget support from Kuovane, solve conflict
drelaptop 6ad5b2c
Merge remote-tracking branch 'root/master' into export-widget-to-layout
drelaptop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
creator_project/packages/creator-luacpp-support/core/parser/Widget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
let Utils = require('./Utils'); | ||
|
||
class Widget { | ||
static parse(data) { | ||
let result = {}; | ||
|
||
result.isAlignOnce = data.isAlignOnce; | ||
result.alignFlags = data._alignFlags; | ||
|
||
// margin value, only support pixel, didn't support percentage | ||
result.left = data._left; | ||
result.right = data._right; | ||
result.top = data._top; | ||
result.bottom = data._bottom; | ||
result.verticalCenter = data._verticalCenter; | ||
result.horizontalCenter = data._horizontalCenter; | ||
|
||
// If true, value is pixel, otherwise is percentage (0 - 1) | ||
// invalid value in cocos2d-x | ||
result.isAbsLeft = data._isAbsLeft; | ||
result.isAbsRight = data._isAbsRight; | ||
result.isAbsTop = data._isAbsTop; | ||
result.isAbsBottom = data._isAbsBottom; | ||
result.isAbsHorizontalCenter = data._isAbsHorizontalCenter; | ||
result.isAbsVerticalCenter = data._isAbsVerticalCenter; | ||
|
||
Utils.log("parse widget result value:" + JSON.stringify(result)); | ||
|
||
return result; | ||
} | ||
} | ||
|
||
|
||
module.exports = Widget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably don't need this in the final PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review this, I will change it to
false
in the final. Are you satisfied with this implement of Widget Component?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself looks fine to me, but I'm not familiar with positional layouts enough to say one way or the other