August_Alonso Posted June 24, 2014 Share Posted June 24, 2014 How to use wordBreak in dxDrawText? Wiki: wordBreak: if set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line. It does not wrap to a new line =( local message = "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla" dxDrawText(message, screenx/2, screeny/2, 300, 300, tocolor(50, 50, 50, 255), 0.5, smallarial, "left", "top", false, true, false) Link to comment
vx89 Posted June 24, 2014 Share Posted June 24, 2014 Let's assume your game resolution is a minimum one, so it's 800x600. Then x1 = screenx/2 = 800/2 = 400 y1 = screeny/2 = 600/2 = 300 and x2 = 300 y2 = 300 where x2 is the "right" argument and y2 is the "bottom" argument. However, you probably wanted x1+300 and y1+300, so instead you should put x2 = 400+300 = 700 y2 = 300+300 = 600 These numbers work for 800x600 resolution and just illustrates the issue. Link to comment
Moderators IIYAMA Posted June 24, 2014 Moderators Share Posted June 24, 2014 How to use wordBreak in dxDrawText?Wiki: wordBreak: if set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line. It does not wrap to a new line =( local message = "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla" dxDrawText(message, screenx/2, screeny/2, 300, 300, tocolor(50, 50, 50, 255), 0.5, smallarial, "left", "top", false, true, false) I had the same problem in one of my scripts. It seems it doesn't work afaik. But anyway the 3th and 4th arguments aren't the size, but the X(end) and Y(end) positions of the bounding box. Which even makes it impossible to let it work. Should be: (screenx/2)+300, (screeny/2)+300Especially when you are going to change the position of the text in the boundingbox. Some people say it is the size, but trust me it isn't that. Link to comment
Moderators IIYAMA Posted June 25, 2014 Moderators Share Posted June 25, 2014 It works? O_o Link to comment
August_Alonso Posted June 25, 2014 Author Share Posted June 25, 2014 Yep! dxDrawText(message, screenx/2-145, screeny-25, screenx/2+135, 0, tocolor(50, 50, 50, 255), 0.5, smallarial, "left", "top", false, true, true, false) 1 arg. - message 2 arg. - position of left board 3 arg. - position of top board 4 arg. - position of end of left board 5 arg. - position of end of top board Link to comment
August_Alonso Posted June 25, 2014 Author Share Posted June 25, 2014 https://yadi.sk/i/F_-q04-QUoweG https://yadi.sk/i/BEgAzj5YUowfD Link to comment
Et-win Posted June 25, 2014 Share Posted June 25, 2014 https://yadi.sk/i/F_-q04-QUoweG https://yadi.sk/i/BEgAzj5YUowfD Post the Image URL link, because why we should have to download it? Link to comment
Moderators IIYAMA Posted June 25, 2014 Moderators Share Posted June 25, 2014 https://yadi.sk/i/F_-q04-QUoweG https://yadi.sk/i/BEgAzj5YUowfD Nice! Link to comment
August_Alonso Posted June 25, 2014 Author Share Posted June 25, 2014 https://yadi.sk/i/F_-q04-QUoweG https://yadi.sk/i/BEgAzj5YUowfD Post the Image URL link, because why we should have to download it? Sorry, but it's has big size =( You can dont download it, click to link for show screen. Link to comment
vx89 Posted July 1, 2014 Share Posted July 1, 2014 It seems yadi.sk doesn't show images if you have Disconnect extension enabled in Google Chrome. Link to comment
Arnold-1 Posted July 1, 2014 Share Posted July 1, 2014 is it just me or everyone is speaking about a different topic? now 1: for word break. it works perfectly for me, but if you have problems with it, use /n to create a new line. 2: making it suit every resolution: you can easily do it by doing this: local x,y = guiGetScreenSize() local scale = x/(your resolution) then dxDrawText(number*scale,number*scale.....etc) 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