Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Text Position

Years of Service
User Offline
Joined: 23rd Oct 2010
Location: Italy
Posted: 31st Dec 2017 17:51
Hi, first of all HAPPY NEW YEAR to ALL

I need help for Text

I have three letter (in vector vstring$) printed on screen with Arial.ttf font
they are printed one every 100 pixel and are printed with color black,
this is an example code.



for u= 1 to 3
tx2[u] = createtext(vstring$[u])
SetTextFont(tx2[u], font)
SetTextSize(tx2[u], 80)
SetTextPosition(tx2[u],100 * u ,500)

now I answer this:
in this example the position X of the letter is Known
but in my real code is not known because it is parametric and non fixed

how I can know the position of 3 letter ? AppGameKit have SetTextPosition but not a command GetTextPosition
I need to know in pixel the initial position of the 3 single letter .
thank you

User Banned
Posted: 31st Dec 2017 17:55
Isnt it

x=300 and y =500

you did u=1 to 3 and times by 100 so the 3rd one must be 3 x 100

Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 31st Dec 2017 18:19 Edited at: 31st Dec 2017 18:21
You can use GetTextX() and GetTextY()

Look at:

oh...and... Happy New year

Login to post a reply

Server time is: 2023-09-21 13:15:23
Your offset time is: 2023-09-21 13:15:23