0 votes


It is possible to had a variable or something else in bbcode like this ?
I want the image to be responsive.

[img=90vw]{image path}[/img]
[img=90%]{image path}[/img]

Thanks !

Godot version 3,3 rc6
in Engine by (209 points)

1 Answer

0 votes
Best answer

you want to use a % sign in a string? if so use %%

my_var = "my percentage: %s%%" % int(round((float(CURRENT_VAR) / MAX_VAR) * 100))
my percentage: 100%
by (367 points)
selected by

Thanks but not working.
Found a "simple" solution :

var size = "500" (or get_viewport_rect().size.x)
[img=" + size + "]res://image.png[/img]
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.