![]() |
Chat System Word Wrapping
I recently scripted a new chat system for Syn, and it works fine except for one thing -- how can I get the text to word wrap? Here's an example:
|---text text te| ( text text text is what it needs to show ) ( | is the border ) |--------o-----| ( o is the player ) It centers over the player, but I don't want it to go over where players cannot see it (screenwidth). Someone said use textwidth, but I couldn't get that to work, it seems like it wasn't translated to GS2 properly. Is there any way, still using a show text (not a gui) to do this? I don't think I'd be able to do it with a GUI either, so ... yah. Any help is greatly appreciated. Thanks, Chris Zakuto NAT of Syn |
gettextwidth() is the GS2 version.
|
That really doesn't answer my question. I was using that, but it seems it wasn't moved from GS1 to GS2 right ... for example
PHP Code:
PHP Code:
|
You should proubably try checking if the texts x plus its width are greater than screenwidth.
|
wraptext2(pixel width,zoom,delimiters,text)
This will give you an array of lines separated at the delimiters that fits in the pixel width. It's probably much more useful to you than textwidth in this case. |
uhh ... I really don't get that. lol
|
That, and gettextwidth takes a fourth parameter.
|
I managed to get wraptext2 to work, now I just need to figure out how to use gettextwidth ... anyone care to tell me the paramaters?
|
Returns the width of a specified text in a certain font. Format:
PHP Code:
|
All times are GMT +2. The time now is 09:36 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.