Jump to content

[Solved] what's wrong ?


Sora

Recommended Posts

hi .. i've drew a text with guieditor and my screen resolution was 800x600x32

dxDrawText("Sora :",13.0,167.0,55.0,182.0,tocolor(255,0,0,255),1.0,"default-bold","left","top",false,false,false) 
dxDrawText(message,58.0,168.0,799.0,224.0,tocolor(255,255,255,255),1.0,"default-bold","left","top",false,false,false) 
  

( works fine )

and i found out that the text place changes on another screen resolutions

i wanted the script to be shown in the same place on all screen resolutions so i used this function

guiGetScreenSize() 

i've followed the tutorial step by step and the results was this

  
local sWidth,sHeight = guiGetScreenSize() 
dxDrawText("Sora :",13.0/800*sWidth,167.0/600*sHeight,55.0/800*sWidth,182.0/600*sHeight,tocolor(255,0,0,255),1.0,"default-bold","left","top",false,false,false) 
    dxDrawText(message,58.0/800*sWidth,168.0/600*sHeight,799.0/800*sWidth,224.0/600*sHeight,tocolor(255,255,255,255),1.0,"default-bold","left","top",false,false,false) 

( doesn't work )

but the text didn't show up on the screen

Edited by Guest
Link to comment
Instead of numbers like:

245, you do 0.245 * screenWidth.

do you mean like that? ^^

local sWidth,sHeight = guiGetScreenSize() 
dxDrawText("Sora :",0.13*sWidth,0.167*sHeight,0.55*sWidth,0.182*sHeight,tocolor(255,0,0,255),1.0,"default-bold","left","top",false,false,false) 
    dxDrawText(message,0.58*sWidth,0.168*sHeight,0.799*sWidth,0.224*sHeight,tocolor(255,255,255,255),1.0,"default-bold","left","top",false,false,false) 

Edited by Guest
Link to comment
        dxDrawText ( "Sora:", ( 0.025 * sWidth ), ( 0.279 * sHeight ), ( 0.55 * sWidth ), ( 0.182 * sHeight ), tocolor ( 255, 0, 0, 255 ), 1.0, "default-bold", "left", "top", false, false, false ) 
        dxDrawText ( message, ( 0.08 * sWidth ), ( 0.280 * sHeight ), ( 0.799 * sWidth ), ( 0.224 * sHeight ), tocolor ( 255, 255, 255, 255 ), 1.0, "default-bold", "left", "top", false, false, false ) 

Seems to be fine on 800x600x32 and 1024x768x32.

Link to comment
        dxDrawText ( "Sora:", ( 0.025 * sWidth ), ( 0.279 * sHeight ), ( 0.55 * sWidth ), ( 0.182 * sHeight ), tocolor ( 255, 0, 0, 255 ), 1.0, "default-bold", "left", "top", false, false, false ) 
        dxDrawText ( message, ( 0.08 * sWidth ), ( 0.280 * sHeight ), ( 0.799 * sWidth ), ( 0.224 * sHeight ), tocolor ( 255, 255, 255, 255 ), 1.0, "default-bold", "left", "top", false, false, false ) 

Seems to be fine on 800x600x32 and 1024x768x32.

worked

thanks a lot ^^

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...