Jump to content

text is great


Fabioxps

Recommended Posts

I do not want the text gets bigger when the player leaves close

addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), math.min ( 0.4 * ( 20 / distance ) * 1.4, 4 ), "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

Link to comment

you even don't checked wiki .........

https://wiki.multitheftauto.com/wiki/DxDrawText , after variable color there is a variable caled "SIZEEEEEEEEE"

As you can see in your dxDraw

size variable = math.min ( 0.4 * ( 20 / distance ) * 1.4 where is distance = the size is changeing when the distance is bigger.

To keep text the same size is veryyyyyyyyy logical that in size variable you dont need "distance" =>> you need a constant int value like 2.

P.S next time check wiki first and don't wait everything 100% done (who want a server , learn lua)

  
  
addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), 2, 4 ), "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

Link to comment
you even don't checked wiki .........

https://wiki.multitheftauto.com/wiki/DxDrawText , after variable color there is a variable caled "SIZEEEEEEEEE"

As you can see in your dxDraw

size variable = math.min ( 0.4 * ( 20 / distance ) * 1.4 where is distance = the size is changeing when the distance is bigger.

To keep text the same size is veryyyyyyyyy logical that in size variable you dont need "distance" =>> you need a constant int value like 2.

P.S next time check wiki first and don't wait everything 100% done (who want a server , learn lua)

  
  
addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), 2, 4 ), "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

thanks but not works

Link to comment
  
  
addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), 2, "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

Link to comment
  
  
addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), 2, "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

the letter continues increasing

Link to comment
  
  
addEventHandler ( "onClientRender", root, dxCreatePodium1s ) 
  
function dxCreatePodium1s () 
        local x,y,z = getElementPosition(thirdCards) 
    --  z = z + 2 
        local px,py,pz = x+5, y+10, z+2 
        local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
        if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.55, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
                    local scale = 1 / ( 0.3 * ( distance / 150 ) ) 
                    dxDrawText ( "Fabioxps", sx, sy - 70, sx, sy - 60, tocolor ( 255, 255, 255, 255 ), 2, "default-bold", "center", "bottom", false, false, false, true ) 
                --end 
            --end 
        --end 
    end 
end 

the letter continues increasing

????

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