novo Posted December 4, 2011 Share Posted December 4, 2011 Hi all. I want make borders to an dxtext. Please help Thank you <3 !!! Link to comment
DiSaMe Posted December 4, 2011 Share Posted December 4, 2011 Draw a few black (or whatever you want the border color to be) labels with some offset and the main label on the top. Example: dxDrawText("Text with border",100-1,100,100-1,100,tocolor(0,0,0,255)) dxDrawText("Text with border",100+1,100,100+1,100,tocolor(0,0,0,255)) dxDrawText("Text with border",100,100-1,100,100-1,tocolor(0,0,0,255)) dxDrawText("Text with border",100,100+1,100,100+1,tocolor(0,0,0,255)) dxDrawText("Text with border",100,100,100,100,tocolor(255,255,255,255)) This will draw white text with black border at coordinates (100, 100). The border width will be 1 because this number is added to or subtracted from border labels. Link to comment
novo Posted December 4, 2011 Author Share Posted December 4, 2011 How can i change this: dxDrawColorText ('#00FF00Spectators: (#FFFFFF' .. #Spectators .. '#00FF00)', 2, screenHeight - dxGetFontHeight(3.00, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.55, 'bankgothic', 0.55, 'left') ? Plz help. Thanks <3 Link to comment
unknooooown Posted December 4, 2011 Share Posted December 4, 2011 How can i change this: dxDrawColorText ('#00FF00Spectators: (#FFFFFF' .. #Spectators .. '#00FF00)', 2, screenHeight - dxGetFontHeight(3.00, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.55, 'bankgothic', 0.55, 'left') ? Plz help. Thanks <3 How can I change this? doifjsdfjsdoijfsdofjdasogjsoåajgsdoifjsdfjsdoijfsdofjdasogjsoåajgsdoifjsdfjsdoijfsdofjdasogjsoåajgs Please be a little more clear when you ask questions... Link to comment
novo Posted December 4, 2011 Author Share Posted December 4, 2011 I mean, how can i change that code for have borders. Link to comment
unknooooown Posted December 4, 2011 Share Posted December 4, 2011 I mean, how can i change that code for have borders. First.. Is ' dxDrawColorText ' a custom function you have written? ' dxDrawColorText ' does not exist in MTA. You should use ' dxDrawText ' Have a look at this example local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution function createText ( ) local playerX, playerY, playerZ = getElementPosition( getLocalPlayer() ) -- Get player's coordinates. local playerZoneName = getZoneName( playerX, playerY, playerZ ) -- Get name of the player's zone. dxDrawText( playerZoneName, 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) -- Draw Zone Name text shadow. dxDrawText( playerZoneName, 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) -- Draw Zone Name text. end function HandleTheRendering() addEventHandler("onClientRender",rootElement, createText) -- keep the text visible with onClientRender. end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) Source: https://wiki.multitheftauto.com/wiki/DxDrawText Link to comment
DiSaMe Posted December 4, 2011 Share Posted December 4, 2011 I mean, how can i change that code for have borders. In the same way I wrote: DRAW A FEW LABELS WITH SOME OFFSET. Link to comment
unknooooown Posted December 4, 2011 Share Posted December 4, 2011 I mean, how can i change that code for have borders. In the same way I wrote: DRAW A FEW LABELS WITH SOME OFFSET. You dont have to write 5 lines to do that. Take a look at the Wiki example I posted, it does exactly the same with 2 lines. Link to comment
DiSaMe Posted December 4, 2011 Share Posted December 4, 2011 It's not the same. A few displaced labels give the border the same width in all places, while one scaled label makes the border thinner near the center. Sometimes the difference may be small enough, but my way is more universal. 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