Cadu12 Posted March 3, 2011 Share Posted March 3, 2011 I do wanted how do it, please it? There no is wiki, forum searched Link to comment
Castillo Posted March 3, 2011 Share Posted March 3, 2011 There is no way of doing this, but you could make a converter from R, G, B to HEX maybe. Link to comment
Wojak Posted March 3, 2011 Share Posted March 3, 2011 this is youre lucky day, I needed that conwerter recently function guiLabelSetHexColor (theelement, color) local hexTodecim = {["0"]=0,["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,["8"]=8,["9"]=9,["a"]=10,["b"]=11,["c"]=12,["d"]=13,["e"]=14,["f"]=15} local red = (hexTodecim[string.lower(string.sub(color, 2, 2))]*16) + hexTodecim[string.lower(string.sub(color, 3, 3))] local green = (hexTodecim[string.lower(string.sub(color, 4, 4))]*16) + hexTodecim[string.lower(string.sub(color, 5, 5))] local blue = (hexTodecim[string.lower(string.sub(color, 6, 6))]*16) + hexTodecim[string.lower(string.sub(color, 7, 7))] guiLabelSetColor(theelement,red,green,blue) end paste the function somewhere in youre script and use guiLabelSetHexColor (theelement, hexcode) instead of guiLabelSetColor(theelement,red,green,blue) Link to comment
Cadu12 Posted March 3, 2011 Author Share Posted March 3, 2011 It works, but rankingboard_clint.lua in race resource, it says PiG|#FF0000Cadu12 I wanted to be PiG|Cadu12 here code: function createShadowedLabelFromSpare(x, y, width, height, text, align) if #spareElems < 2 then if not donePrecreate then outputDebug( 'OPTIMIZATION', 'createShadowedLabel' ) end return createShadowedLabel(x, y, width, height, text, align) else local shadow = table.popLast( spareElems ) guiSetSize(shadow, width, height, false) guiSetText(shadow, text) --guiLabelSetColor(shadow, 255, 119, 0) --guiSetSize(shadow, 1, 1, true) guiSetPosition(shadow, x + 1, y + 1, false) guiSetVisible(shadow, true) local label = table.popLast( spareElems ) guiSetSize(label, width, height, false) guiLabelSetHexColor(label, text) guiSetText(label, string.gsub ( text, '#%x%x%x%x%x%x', '' )) --guiSetSize(label, 1, 1, true) guiSetPosition(label, x, y, false) guiSetVisible(label, true) if align then guiLabelSetHorizontalAlign(shadow, align) guiLabelSetHorizontalAlign(label, align) else guiLabelSetHorizontalAlign(shadow, 'left') guiLabelSetHorizontalAlign(label, 'left') end return label, shadow end end Link to comment
Castillo Posted March 3, 2011 Share Posted March 3, 2011 A label can't have two colors. Link to comment
Cadu12 Posted March 3, 2011 Author Share Posted March 3, 2011 Ewwww, ok, thanks you But EPG have with colors for rankingboard Edit: He is using dxText? 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