Overkillz Posted October 23, 2013 Posted October 23, 2013 How i can give color to this word " Map: " g_dxGUI['travelText2']:text(mapName and "[color=#FF0000]Map:[/color] " .. mapName or "") I wait your answer, thanks for all Regards.
Castillo Posted October 23, 2013 Posted October 23, 2013 The race game mode uses a text library, in order to enable HEX color codes, you must edit that library.
Overkillz Posted October 23, 2013 Author Posted October 23, 2013 The race game mode uses a text library, in order to enable HEX color codes, you must edit that library. thanks for all but, Can u tell me where i can find it ? I started on this 1 month ago and Im only living with addons
Castillo Posted October 23, 2013 Posted October 23, 2013 Go to "race/textlib.lua" and search for dxDrawText, then you must enable the colorCoded argument of the function.
Overkillz Posted October 23, 2013 Author Posted October 23, 2013 Go to "race/textlib.lua" and search for dxDrawText, then you must enable the colorCoded argument of the function. Will be how this ? dxDrawText(self.strText, l + offsetX, t + offsetY, r + offsetX, b + offsetY, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end end end end elseif type == "shadow" then local shadowDist = att1 att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] dxDrawText(self.strText, l + shadowDist, t + shadowDist, r + shadowDist, b + shadowDist, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) end dxDrawText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI ) IDK how I could get only this: - gsub( '#%x%x%x%x%x%x', '') or this - ,255,255,255,true) Regards.
Castillo Posted October 23, 2013 Posted October 23, 2013 dxDrawText(self.strText, l + offsetX, t + offsetY, r + offsetX, b + offsetY, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI, true ) end end end end elseif type == "shadow" then local shadowDist = att1 att2 = att2 or 0 att3 = att3 or 0 att4 = att4 or 0 att5 = att5 or self.tColor[4] dxDrawText(self.strText, l + shadowDist, t + shadowDist, r + shadowDist, b + shadowDist, tocolor(att2, att3, att4, att5), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI, true ) end dxDrawText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI, true ) Try it.
Overkillz Posted October 24, 2013 Author Posted October 24, 2013 Thanks for all, all working correctly, but now i want to see the tag colour from others user, i can´t see. dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) Need to bee this ? dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true) ? Regards.
Castillo Posted October 25, 2013 Posted October 25, 2013 dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true)
Overkillz Posted October 25, 2013 Author Posted October 25, 2013 Doesnt work dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true) dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true) mmm IDK why it doesnt work.
Castillo Posted October 25, 2013 Posted October 25, 2013 Race game mode removes the HEX color codes, instead of using getPlayerName, use _getPlayerName. dxDrawText ( _getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true) dxDrawText ( _getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true)
Overkillz Posted October 25, 2013 Author Posted October 25, 2013 Working perfectly, but i prefer the color for default be tocolor(255,255,255) What i need to do for change the font ? textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, true) textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", true, true, true, false) Is here ?
Overkillz Posted October 28, 2013 Author Posted October 28, 2013 Work perfectly, now I want to change the font from server info: to this: IDK if is dxscoreboard_client or dxscoreboard_clientsettings If is possible, tell me the line. Thanks again
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