Sora Posted November 28, 2012 Share Posted November 28, 2012 (edited) 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 Solved Go to solution Edited November 28, 2012 by Guest Link to comment
Castillo Posted November 28, 2012 Share Posted November 28, 2012 I had this problem too not long ago, and a friend told me to use offsets instead of pixels and that worked. Link to comment
Sora Posted November 28, 2012 Author Share Posted November 28, 2012 I had this problem too not long ago, and a friend told me to use offsets instead of pixels and that worked. thanks for replay ^^ how do i get offsets , and how to set them on the same place up there ^ Link to comment
Castillo Posted November 28, 2012 Share Posted November 28, 2012 Instead of numbers like: 245, you do 0.245 * screenWidth. Link to comment
Sora Posted November 28, 2012 Author Share Posted November 28, 2012 (edited) 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 November 28, 2012 by Guest Link to comment
Castillo Posted November 28, 2012 Share Posted November 28, 2012 In what resolution was it designed? Link to comment
Sora Posted November 28, 2012 Author Share Posted November 28, 2012 In what resolution was it designed? 800x600x32 Link to comment
Castillo Posted November 28, 2012 Share Posted November 28, 2012 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
Sora Posted November 28, 2012 Author Share Posted November 28, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now