Jump to content

dxDrawText clip problem


Overkillz

Recommended Posts

Hey dear community, I have a little doubt about clip on dxDrawText.

I already saw the function, arguments ...etc however, I couldnt do it.

function testing() 
dxDrawRectangle(sX/2-sizeX/2,sY-sizeY,sizeX,sizeY,tocolor(0,0,0,200)) 
dxDrawRectangle(sX/2-sizeX/2,sY-sizeY,sizeX,line,tocolor(0,0,0,255)) 
dxDrawText(Songname,sX/2-sizeX/2,sY-sizeY,sX/2+sizeX/2,sY+sizeY/2,tocolor(255,255,255,255),1,"default-bold","center","center",true,false,false,false) 
end 
  

Variables are already defined. Can someone tell me why the text when it is so big, it still being drawed out the dxDrawRectangle ?

I hope you can help me, thanks for all, regards.

Link to comment

Are you sure you know where the box ends?

dxDrawText takes the start and end coordinates, unlike dxDrawRectangle that takes start coordinates and width/height.

Also clipping doesn't work when using colorcodes. For that you would have to manually clip it.

Link to comment
Also clipping doesn't work when using colorcodes. For that you would have to manually clip it.

By looking at the amount of parameters in his call, he's disabling colorcodes. Therefore the clipping should just work, the only thing that can be wrong is his offsets for the box.

Try this; (untested)

function testing() 
    dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, sizeY, tocolor ( 0, 0, 0, 200 ) ); 
    dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, line, tocolor ( 0, 0, 0, 200 ) ); 
    dxDrawText ( songName, ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, ( ( sX / 2 ) - ( sizeX / 2 ) ) + sizeX, ( sY - sizeY ) + line, tocolor ( 255, 255, 255, 255 ), 1, "defauld-bold", "center", "center", true ); 
end 

Link to comment
Also clipping doesn't work when using colorcodes. For that you would have to manually clip it.

By looking at the amount of parameters in his call, he's disabling colorcodes. Therefore the clipping should just work, the only thing that can be wrong is his offsets for the box.

Try this; (untested)

function testing() 
    dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, sizeY, tocolor ( 0, 0, 0, 200 ) ); 
    dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, line, tocolor ( 0, 0, 0, 200 ) ); 
    dxDrawText ( songName, ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, ( ( sX / 2 ) - ( sizeX / 2 ) ) + sizeX, ( sY - sizeY ) + line, tocolor ( 255, 255, 255, 255 ), 1, "defauld-bold", "center", "center", true ); 
end 

Thanks it worked, I catch the problem and I have seen how it should work.

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