-
Notifications
You must be signed in to change notification settings - Fork 45
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
Cannot control order in which objects under Prefab Group are instantiated #79
Comments
Looking at this further, I suppose Canvas Design object order does not work as I expected either. In which case, I guess this issue is an enhancement request. I would expect an in-order traversal of the Design Objects tree to determine the order in which all objects are ordered in groups and thus rendered (Z depth). The Z depth is what is most important to me. It would reduce the amount of grouping and reordering necessary to get the compositing effects I want. |
I will take a look. |
Hello @puzzud, Please, can you show here an image with the wrong order? Look this image I attach here. It shows the order of the objects in a prefab scene and the order in code of the objects of the same scene. In code, the object in the bottom is created first. |
Hmm. You're right in that is the order I get. Perhaps I'm encountering a Phaser bug or some intended behavior that I did not expect. My workaround is to add all objects into the prefab group Alternatively, if Phaser Editor were to automatically add these objects as children of the prefab, sending the tilemap to the back is not necessary. However, I suppose there is a good reason to not necessarily add these objects as children? Perhaps some of the children need to be in other groups? |
I am trying to reproduce your behavior but I can't. Please can you show an image of your code and scene? I have interest on find the bug or make clear what is happening. If you cannot show an image maybe you can do a small project where the error is reproduced and attach it here. |
I'll put together a small project and attach when time permits.
…On Mon, Jun 18, 2018 at 10:35 PM, Phaser Editor ***@***.***> wrote:
I am trying to reproduce your behavior but I can't. Please can you show an
image of your code and scene? I have interest on find the bug or make clear
what is happening. If you cannot show an image maybe you can do a small
project where the error is reproduced and attach it here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAcyXy-81dytzO_oass9tgLFPCBsvKyYks5t-GNVgaJpZM4Uhv4c>
.
|
Ok thanks. |
Added a small project that illustrates this issue: |
Hi @puzzud Please, can you tell me what's the problem with that project? I see some Canvas files but I don't know where to look. Thanks. |
@PhaserEditor2D, the order of objects defined under a prefab group does not have an impact on the order in which they are drawn. Running this project, you'll see some examples where text should be see on top of a tilemap. Maybe I'm misinterpreting behavior or maybe Phaser Editor can insert more code. I'm not entirely sure on this one. I'll defer to your best judgement and Phaser knowledge. |
Hi @puzzud, We are too busy migrating the editor to Phaser 3, but we are going to do a pause to release a new version of the v1 series. I will take a look at this issue again. |
@puzzud It is a Phaser Editor bug. The tilemap layer should be added to the prefab group, something like this:
|
The tilemap layer was added always to the world group and not the real group. In addition, the `fixedToCamera` property is set to `true` by default, as it is in Phaser v2.
Done. Now the layer is added to the prefab group. But also take in consideration that it is fixed to the camera by default, so if you want to move it to other position you should set the fixedToCamera false, or change the |
The order in which objects are listed in a Canvas' list of objects in Design seems to indicate the order in which they are instantiated in code.
The order in which objects are listed in a Prefab Group's list of objects in Design seems to be nearly uncontrollable--after fiddling with it a bit, I could not determine a way to work around this issue. It's using some internal logic to determine order of instantiation.
It would be ideal if this instantiation order was consistent with how it's done directly under a Canvas.
The text was updated successfully, but these errors were encountered: