Overkillz Posted February 5, 2016 Share Posted February 5, 2016 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
Bonsai Posted February 5, 2016 Share Posted February 5, 2016 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
tosfera Posted February 5, 2016 Share Posted February 5, 2016 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
Overkillz Posted February 5, 2016 Author Share Posted February 5, 2016 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
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