Jump to content

Help


UnG//Macaus

Recommended Posts

How can I add color codes in my text? I tried this but does not work

function dxDrawBorderedText(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded) 
    text_ = text:gsub ( "#%x%x%x%x%x%x", "" ) 
    dxDrawText(text_, x - 0.6, y - 0.6, w - 0.6, h - 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x + 0.6, y - 0.6, w + 0.6, h - 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x - 0.6, y + 0.6, w - 0.6, h + 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x + 0.6, y + 0.6, w + 0.6, h + 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x - 0.6, y, w - 0.6, h, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x + 0.6, y, w + 0.6, h, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x, y - 0.6, w, h - 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text_, x, y + 0.6, w, h + 0.6, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false, true) 
    dxDrawText(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded) 
end 

dxDrawBorderedText(Text, x*150, y*540, x*1400, y*385, tocolor(255, 255, 255, 255), x*2.4, x*2.4, "clear", "center", "center", false, false, true, true) 

Link to comment
function dxDrawBorderedText(text, left, top, right, bottom, color, scale, outlinesize, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded) 
    outlinesize = math.min(scale, outlinesize) 
    if outlinesize > 0 then 
        for offsetX=-outlinesize,outlinesize,outlinesize do 
            for offsetY=-outlinesize,outlinesize,outlinesize do 
                if not (offsetX == 0 and offsetY == 0) then 
                    dxDrawText(text:gsub("#%x%x%x%x%x%x",""), left+offsetX, top+offsetY, right+offsetX, bottom+offsetY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI) 
                end 
            end 
        end 
    end 
    dxDrawText(text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded) 
end 
  

Try it.

dxDrawBorderedText(Text, x*150, y*540, x*1400, y*385, tocolor(255, 255, 255, 255), 1, 1, "clear", "center", "center", false, false, true, true) 

Just edit the arguments: scale and the size of the border, if it's nedded.

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