[Solved] Canvas move sprites up and down

Hello!

I’ve noticed that when creating a canvas you can’t move the sprites up and down, I wanted to know where I can suggest this improvement?

Whenever you’re adding sprites the items that are at the bottom will show in front of all objects.

Also how can you create sprites under other sprites type other than duplicating it. That may be a problem I’m having or another issue with the canvas.

BTW huge fan of the Canvas Tab, really easy to use it and saves a lot of code :smiley:

1 Like

Thanks for the feedback @Sofia!

Is this something you need to do dynamically, or is it ok to set everything up at design time?

If so, you can move your sprites up and down the component tree to set them as a higher or lower “layer”

Hope that helps!

Hello!

You’re right. Z-order - it is necessary for the functionality of the game. it is not now, and in the case of dynamically creating sprites, there is only one way to organize them as necessary - using an order for the creation of sprites.

Unfortunately, the canvas coordinate system and the screen do not match and this makes it difficult to use the components in conjunction with absolute positioning with the canvas. But if the project is scheduled to run only on one device, it is possible to solve some problems. For example, you can arrange the components above the canvas and make sprites fading out beneath them.

Hey Domnhall!

Thank you for quick response :slight_smile: I don’t need it to do it dynamically. :slight_smile: I know that there is a z-order implied (like @actech suggests it can be fixed) but I can’t seem to move the sprites up and down like you suggested. That’s why I opened this issue :smiley:

I’ve included a video this time. Hope it can help shed a little light in the bug/issue.

Video Here

I found a work around the problem by just duplicating the initial sprite that comes with the canvas and working my way from back to front of sprites orders.

1 Like

Thanks for the update @Sofia,

The sprites in your video look great - just a pity they won’t move up or down the component tree!

Glad to hear you were able to to find a workaround for the time being at least, but will follow up with you if I figure out a solution to this.

1 Like

@ sogalanbatm5ql “I found a work around the problem by just duplicating the initial sprite that comes with the canvas and working my way from back to front of sprites orders”.

This workaround has the disadvantage that after using it will be impossible to change the order of the creation of sprites. The fact that CreateSpriteType block creates only one sprite of the selected type, even if this type has several sprites. For this reason, flexible management position sprites on the Z-axis is necessary in every type of sprites to create only a single sprite. This will require a lot of extra activities for the group settings, but will allow to programmatically create sprites in any order.

@Sofia @actech Our latest release adds a z property to sprites on the canvas so you can move them in front and behind each other easily.

4 Likes

Great! :slight_smile: Thank you @paulmw

1 Like