How to make a text right to left in this case?

Hello
I have a template for a quiz of multiple choices, But texts in it are left to write, Now I want to make it right to left because my language is Arabic, I tried with BBtext but it did not work with me, Here is the file, I hope anybody helps me.
https://archive.org/download/quiz-game-template-gdevelop-5-adb/Quiz-Game-Template-GDevelop5-adb.rar

You can’t right-align text, but you can reposition the text box.

If you know the right margin (let’s refer to it as rightMargin), then you can calculate the x position the text object with x = rightMargin - textObject.Width(). Do this every time after you’ve set the text in the textObject.


This is what it looks like in the editor :

image


Here are the events :


And this is the result :

image

2 Likes

I will try it, but I want to ask: does this reposition the direction of the text?

I’m not sure what you mean by this. Reverse it? Try it out and see what happens.

Yes, I mean that, Do you mean out of the gdevelop? it is already from right to left out of the app.

Yes. The repositioning won’t change the direction of the text, it just moves the text box and its contents to another location on the screen.

1 Like

And I think I’ve misunderstood your initial question. You want the text reversed in the box, right?

1 Like

Yes, I want that. My language is Arabic, It is from right to left.

1 Like

The best way to reverse a string in GDevelop is with JavaScript. Here’s an example of how :

Here are the 2 text objects on the scene :


Here are the scene events :


And here is the output :

image


I hope this helps with your original request.

1 Like

Kattan, I’ve been confused by your request. Your quiz will be multiple choice. So the player won’t have to type answers, they’ll just be selecting one of the choices. So would this work for you:

Type the questions and answers in your usual Arabic text editor that is right to left
Paste them into the question and answer text boxes in Gdevelop
Right align the text boxes as mentioned earlier, if necessary

1 Like