Image size % of width (or responsive) in bbcode

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PEIGNAULT Laurent

Hi,

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


or

Thanks !

:bust_in_silhouette: Reply From: Surtarso

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))
print(my_var)
my percentage: 100%

Thanks but not working.
Found a “simple” solution :

var size = "500" (or get_viewport_rect().size.x)
[img=" + size + "]res://image.png[/img]

PEIGNAULT Laurent | 2021-03-27 19:17