Fabioxps Posted August 16, 2013 Share Posted August 16, 2013 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
Fabioxps Posted August 16, 2013 Author Share Posted August 16, 2013 I want the text always the same size Link to comment
bandi94 Posted August 16, 2013 Share Posted August 16, 2013 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
Fabioxps Posted August 16, 2013 Author Share Posted August 16, 2013 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
bandi94 Posted August 16, 2013 Share Posted August 16, 2013 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
Fabioxps Posted August 16, 2013 Author Share Posted August 16, 2013 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
Fabioxps Posted August 17, 2013 Author Share Posted August 17, 2013 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
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