• 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.

(SOLVED) draw_text(x,y,"string") differes from android to windows

Liquid

Member
Hello

in my project "emerald caves" ( https://forum.yoyogames.com/index.php?threads/emerald-caves.8217/ )
i have alot of objects on my screen and some try to draw text.
they use their x and y coordinates to draw the text inside the drawgui event.

but

on windows :
everything is fine and the text is located at x y whre the object is located that is drawing the text.....

on android :
the text is at a totally different location...though the object is at x y the text is somewhere else... and it depends on the rotation of the screen also... when i rotate my phone the text will be dispayed somewhere else again.


! any idea how i can make windows and android looking the same ?

Thanks

ps .. i tried the html5 exporter but it wont work as well.. game wont load... it seems html5 cant handle "with (object) {...}" ..but im not sure
 

Llama_Code

Member
The draw gui event uses the application surface size to set its coordinates, so when you are drawing in the gui event, no matter what, you always need to set your text as 0,0 from the top left corner, don't use your objects coordinates, use the screens coordinates. Then you will find it will be identical across all exports.

HTML5 handles with (object) just fine, it sounds like you may have some other issues.
 

Liquid

Member
yes at the moment i use the event "Draw GUI Begin"
i thought it would make sure that its ontop of the normal gfx, but i guess i should change it into "Draw End"...

ill test it now if it works.


edit1:
Its working !
Thank you very much MrLlama_Code :) that was pretty easy to fix
 
Last edited:
Top