Precisely center objects on the scene in the editor

Is there a way to insert an object to Gdevelop in a “precise” way in the sense that the object is set in the center in the X axis without dragging it and therefore without putting it an approximate way?

Not really, no. You can change the x/y coordinates of any placed object by clicking the object and modifying the X/Y position numbers directly on the left, in the properties panel.

image

If you want to center it in the game, just set up an event that modifies the object’s position, then set the value using the expression builder (Blue 123/abc button to the right when you’re setting up an action or condition) to use the Camera Center X position expression.

1 Like

Hey, thank you for the response. There is another easyest method to do this?

The above two options (manually via typing, or during games via events) are the easiest methods.

Do something like this to get your object in the centre in the preview

and in the scene editor, you need to manually type as @Silver-Streak told and also make sure you have your origin point in the centre because if it is not, you will not get results as expected. Look here:
fB2Sl9qXWP
I changed its X position to 400 which is 800/2 and 800 was my width but the button didn’t go to the centre (for me).
But after changing its origin point, it went to the centre (for me).

1 Like

Thank you! This looks so easy i tried and it worked
Also tanks to @Silver-Streak