Android [Optimization] drawing text using draw_sprite instead of draw_text?

artem123

Member
Hi.

Not sure if this is already posted in forums or a similar thread exist but I tried looking and there was no exact thread similar to this. Anyway, I would like to know your insights and experiences regarding this topic. Have you tried to draw or display texts, words (messages, pop-up messages by characters, etc) using draw_sprite instead of draw_text?
For example, I would like to display a message: "Hello World". Instead of using the typical draw_text:

Code:
draw_set_color(c_white)

draw_set_font(font1)

draw_set_alpha(1)

draw_text("Hello World", 100, 100)
I would instead create a sprite with "Hello World" text and do:

Code:
draw_sprite(spr_helloworld, 0, 100, 100)
For those who have experiences regarding this. May I know if there are implications/advantages/disadvantages if I used draw_sprite instead of draw_text to display/show messages/text/sentences? Is draw_text slower than draw_sprite, are there any impact on memory specially of you plan to use draw_text for many times?

Thank you.
 

FoxyOfJungle

Kazan Games
Use draw_text

The performance difference is insignificant, in addition to that you have more control using the text function, and you save disk space (what is paramount for android games), as you will not need many images for various texts. Of course, if it's the Menu logo, you'll use a sprite image.
 
Top