Overkillz Posted July 19, 2015 Share Posted July 19, 2015 Hey dear community, I hope you can help me with this easy problem which I have. I want to add and see Hex colors into the text, I tried to set some arguments "true" but it didn't work. local contador = 3 local alfa = 0 local movimiento = "fadein" local screenWidth, screenHeight = guiGetScreenSize() ------------------------------------------------------------------------------ function createText () if movimiento == "fadein" then contador = contador+1 else contador = contador-1 end if contador <= 100 then alfa = 255*(contador/100) end dxDrawText("#000000"..getPlayerName(getLocalPlayer()).." #000000is the final survivor!", screenWidth/2, screenHeight/3, screenWidth/2, screenHeight/3.5, tocolor ( 255,255, 255, alfa ), 3.22, "default-bold","center") if contador == 2 then removeEventHandler("onClientRender",getRootElement(),createText) end if contador == 200 then contador = 100 movimiento = "negativo" end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Ir show me the hex color code by the player and I wont it. I hope you can help me. Regards. Link to comment
Death Posted July 19, 2015 Share Posted July 19, 2015 try this local contador = 3 local alfa = 0 local movimiento = "fadein" local screenWidth, screenHeight = guiGetScreenSize() ------------------------------------------------------------------------------ function createText () if movimiento == "fadein" then contador = contador+1 else contador = contador-1 end if contador <= 100 then alfa = 255*(contador/100) end dxDrawText("#000000"..getPlayerName(getLocalPlayer()).." #000000is the final survivor!", screenWidth/2, screenHeight/3, screenWidth/2, screenHeight/3.5, tocolor ( 255,255, 255, alfa ), 3.22, "default-bold","center", false,false,false,true) if contador == 2 then removeEventHandler("onClientRender",getRootElement(),createText) end if contador == 200 then contador = 100 movimiento = "negativo" end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Link to comment
GTX Posted July 19, 2015 Share Posted July 19, 2015 You forgot alignY argument. local contador = 3 local alfa = 0 local movimiento = "fadein" local screenWidth, screenHeight = guiGetScreenSize() ------------------------------------------------------------------------------ function createText () if movimiento == "fadein" then contador = contador+1 else contador = contador-1 end if contador <= 100 then alfa = 255*(contador/100) end dxDrawText("#000000"..getPlayerName(getLocalPlayer()).." #000000is the final survivor!", screenWidth/2, screenHeight/3, screenWidth/2, screenHeight/3.5, tocolor ( 255,255, 255, alfa ), 3.22, "default-bold","center", "top", false,false,false,true) if contador == 2 then removeEventHandler("onClientRender",getRootElement(),createText) end if contador == 200 then contador = 100 movimiento = "negativo" end end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Link to comment
Overkillz Posted July 19, 2015 Author Share Posted July 19, 2015 Thanks guys, I needen another argument that I had forgotten. Mybad Thanks newly 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