GDevelop
GDevelop copied to clipboard
[$5 bounty] Text object at wrong position (and moves!)
Describe the bug
A picture is worth a thousand words... well I have four!
Please look on each picture at the position of "Score :" in the editor on the left, and in preview on the right.
All fine here:
Score is higher than 10, still fine.
Text object has been rotated 90°.
Score is higher than 10.
To Reproduce
Place a Text object on an external layout. Rotate the object. Load the layout in a scene.
Other details
GD beta 65, Windows 10
Can you not reproduce this issue?
Can you provide an example file ? Because i tried few things but can reproduce... You seems to use the default font ? No breakline or width limitation on text field ?
Yes @KinkGD , default font and nothing fancy, rotation only.
I just tried the following, it reproduces the issue for me: Create a new game using the default platformer example, rotate the score text 90° and place it next to the coin icon.
Grab coins and watch the text move.
So this is surprising to say the least but per se "working as intended". The thing is that the position of the object is determined by its origin point on the top left BUT the center, used for rotation, is the middle of the object. This means that when the text grow, the center moves to the right, so the object also seems to move to the right when it's rotated.
A solution could be to allow to specify the origin point to be the center, but not sure if there is a better way.
The thing is that the position of the object is determined by its origin point on the top left
I placed a marker on ScoreX/Y(), see what happens:
The second position doesn't look like a top-left corner 😬 (the position was updated, of course)
This means that when the text grow, the center moves to the right, so the object also seems to move to the right when it's rotated.
But the object is rotated, so the center should in fact move down, right?
Am I right to assume that this issue is related to what I will call a weirdity, not to call it a bug:
That's why ;)
The non-rotated object selection mask in the IDE is a bad design that comes from the ice era :D
@PascalLadalle it is solved by beta 110?
Fix sprite objects updating their displayed image one frame too late: This fixes some "flickering" when a sprite is just created, when a scene is changed or when external layout objects are created on a scene. This also fix objects that are not at the proper size/position/angle just after being created in events.
Nope, issue is still there, I'm afraid.
Can you drop the project here, please?
Default platformer with rotated score text: My project28.zip
There is 3 type of text objects with the same issue, https://www.bountysource.com/issues/71408652-text-object-at-wrong-position-and-moves
Here is another project with all types of text objects, all have their own problems when the angle is different from zero. Visually the text objects move, that's the problem, their positions stay the same which is fine. The bounding box does not adapt to the text when it is updated.
Bouh has contributed $5.00 to this issue on Rysolv.
The total bounty is now $5.00. Solve this issue on Rysolv to earn this bounty.
In addition to this issue, I link this thread on the forum.