Jump to content

Little help needed :D


Recommended Posts

Posted

How can I make the dxDrawtext always in the center of the screen in all screen resolutions?

function drawMessage ( ) 
  
    local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
    dxDrawText ( msg, 320, screenHeight - 320, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
  
  
end  

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted
function drawMessage ( ) 
  
    local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
    dxDrawText ( msg,  screenWidth/2, screenHeight/2, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
  
  
end  

Omerta Roleplay

Posted

screen resoultion will not change while client is inside the game, so you can avoid calculating the size of the screen each

frame, and calculate it just one time.

  
local screenWidth, screenHeight = guiGetScreenSize (); 
function drawMessage () 
    dxDrawText ( msg,  screenWidth/2, screenHeight/2, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
end 
  

there are two kinds of people: those who know C++ and those who don´t. .)

Posted
screen resoultion will not change while client is inside the game, so you can avoid calculating the size of the screen each

frame, and calculate it just one time.

  
local screenWidth, screenHeight = guiGetScreenSize (); 
function drawMessage () 
    dxDrawText ( msg,  screenWidth/2, screenHeight/2, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
end 
  

I tested it but it didn't show in the center of the screen?

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted
addEventHandler("onClientRender", root, 
    function() 
  
    local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
    dxDrawText ( msg, 320, screenHeight - 320, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
  
end ) 

Not tested

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

Posted
addEventHandler("onClientRender", root, 
    function() 
  
    local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
    dxDrawText ( msg, 320, screenHeight - 320, screenWidth, screenHeight, tocolor ( 255, 99, 8, 255 ), 2.2, "arial" ) 
  
end ) 

Not tested

You didn't change anythings

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted
  
local sWidth, sHeight = guiGetScreenSize (); 
addEventHandler("onClientRender", root, 
    function() 
msg = "text" 
dxDrawText(msg,sWidth/2, sHeight/2, sWidth, sHeight,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) 
end ) 

for me it's work :D

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

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