-
Notifications
You must be signed in to change notification settings - Fork 837
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
Add possibility to set Z offset when creating instances from external layout #5704
Conversation
@@ -281,7 +281,8 @@ namespace gdjs { | |||
scene: gdjs.RuntimeInstanceContainer, | |||
externalLayout: string, | |||
xPos: float, | |||
yPos: float | |||
yPos: float, | |||
zPos: float, |
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.
I feel like I should either set 0 as default value here or deprecate the method to have createObjectsFromExternalLayout2
because this method is exposed to JS events through gdjs.evtTools.runtimeScene.createObjectsFromExternalLayout
.
Some JS events might use it and it would create bugs.
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.
Alternative to createObjectsFrom2
:
- At least, make the existing createObjectsFrom to call the new version (passing z = 0).
- Alternatively, do some "dynamic magic" by checking the value of
arguments.length
. If it's <= 4, treat zPos as trackByPersistentUuid with some ts-ignore.
So officially we support only the new version, but we have compatibility code to make existing calls still work
c32ff31
to
a595cb7
Compare
a595cb7
to
4d49fde
Compare
First time I use |
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.
lgtm!
Fixes #5694