Set a sprite at half the width of the screen or canvas or stage

When I move Sprite 1 to X ScreenWidth / 2 & Y ScreenWidth / 2 it’s not at all in the middle of the screen.
If I create a label to get the canvas width the label displays “Fill Container” which makes sense bc that’s the setting I have chosen. There is no getStageWidth, there’s only a drawingWidth which is how wide the pen tool or whatever would be so that’s not it.

Is there a simple way to make a sprite be in the middle of the canvas?

Hi @overshield,

I see. I just change the length and width Canvas to Relative size 100% which also will fill the containter and return values with digits.

And then we can use the same way to retrieve the middle of height/width which can be used to place the Sprite position.

1 Like