• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Texts of various colors O.o ¿?

F

fakuover

Guest
The problem I have is that I have texts that require more than one color, here is an example of what I want

1596745084252.png

For that I use the following code
GML:
{
    draw_set_font(home_tittle);
   
    draw_text_colour(10, 35, "BTC: ", c_white, c_white, c_white, c_white, c_white, 1);
    draw_text_colour(70, 35, global.btc_wallet_output, c_orange, c_orange, c_orange, c_orange, 1);
}
But I don't want to use it that way I want everything to be inside a single text.
Is there any way to do it?

EDIT: the reason you want everything in one text is because it uses variables and the length of the text varies and I don't want one text to be above another

PS: sorry my english, i'm very bad :s
 
Last edited by a moderator:

chamaeleon

Member
The problem I have is that I have texts that require more than one color, here is an example of what I want

View attachment 33204

For that I use the following code
GML:
{
    draw_set_font(home_tittle);
  
    draw_text_colour(10, 35, "BTC: ", c_white, c_white, c_white, c_white, c_white, 1);
    draw_text_colour(70, 35, global.btc_wallet_output, c_orange, c_orange, c_orange, c_orange, 1);
}
But I don't want to use it that way I want everything to be inside a single text.
Is there any way to do it?

EDIT: the reason you want everything in one text is because it uses variables and the length of the text varies and I don't want one text to be above another

PS: sorry my english, i'm very bad :s
There is no way just using the built-in functions. What you're looking for is either an extension, or write code yourself, that takes a string, possibly with string interpolation (insert values passed as arguments inside it using some kind of placeholder) and using markup, or some other means, coloring the text as desired. Have a peek at the marketplace, and you're bound to find something that suits your need.
 
Top