Jump to content

wordBreak+colorCoded, Yuno disabling wordBreak, colorDoded?


denny199

Recommended Posts

Hi guys,

I was making my own dx Window and now I strumbeled into a problem, the dxDrawText function is pretty unhandy with colorCoding and wordBreaking.

Let's take for example I want to draw a player name which is "WWWWWWWWWWWWWWW" ( which is too long for say example a DX grid ) , Now I want to combine it with colorCoded and wordBreak, but too sad a wiki note: colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.

Now is my question, does someone has his own dxDrawText function, which draws color codes and has wordBreak enabled for color coded, I can write my own, but why should I if someone else has it for free (ofc if he wants to share it) :P .

Regards,

Danny

Link to comment
function dxDrawTxt ( text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, postGUI, subPixelPositioning ) 
    dxDrawText ( text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, true, postGUI, true, subPixelPositioning ) 
end 

Link to comment

Wooooooow, this IS NOT working, you are forcing to set the variables inside dxDrawText to true, please read the wiki (or my topic post):

right: the absolute X coordinate of the right side of the text bounding box. Used for text aligning, clipping and word breaking.

bottom: the absolute Y coordinate of the bottom side of the text bounding box. Used for text aligning, clipping and word breaking.

(......) -- skip that huge part

clip: if set to true, the parts of the text that don't fit within the bounding box will be cut off. -- I want this, but see beneath

colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.

So I need a costum dxDrawText function with reading the HTML color codes, and then split those away like dxDrawColoredText, and then check if the text is still withing the bounding box.

Link to comment
Wooooooow, this IS NOT working, you are forcing to set the variables inside dxDrawText to true, please read the wiki (or my topic post):

right: the absolute X coordinate of the right side of the text bounding box. Used for text aligning, clipping and word breaking.

bottom: the absolute Y coordinate of the bottom side of the text bounding box. Used for text aligning, clipping and word breaking.

(......) -- skip that huge part

clip: if set to true, the parts of the text that don't fit within the bounding box will be cut off. -- I want this, but see beneath

colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.

So I need a costum dxDrawText function with reading the HTML color codes, and then split those away like dxDrawColoredText, and then check if the text is still withing the bounding box.

Sorry, misreading :P

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