During my game you can collect items with different values (1, 2,…) and I have a panel where I show the whole mathematical operation,
Every item has their variable and the sum is stored in another global variable that I transform to strings in a BBText object i.e. 1+2=3
Until now I have had 2 different text objects (one for the “1+2” and other for “=3” that works well) but I’m triying to keep updated and visible all the information of that panel only in one BBText object to keep simple the alligment and distance among the numbers
The idea is that every time the player collects a new value, the BBText updates itself cutting the text “1+2” until the “=”, and adding “+ new number = result”
But I’m having issues with the “manipulation of text” functionalityand I don’t know how to properly extract the first part of the text.
I’m trying to use “Get a portion of a text (SubStr)” mixed with “Search in a text (StrFind)” (to obtain the position of the “=” in the string)
But the text in the game just dissapears… anyone knows where is the error? (or maybe another way to achieve a solution)
SubStr(ScoreText.GetBBText(), 0, StrFind(ScoreText.GetBBText(), “=”))+"+"+ToString(Level_button.Animation())+"=" + GlobalVariableString(Total)+"[/outline]"
I’ve been exploring all the expressions here: Expressions reference [GDevelop wiki]