Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   wraptext2 (https://forums.graalonline.com/forums/showthread.php?t=80044)

projectigi 06-11-2008 12:33 PM

wraptext2
 
Hi,

is there a way to say to wraptext2 that it shouldnt break words?

like

test test test test test

should be

test test test
test test

instead of

test test test tes
t test

cbk1994 06-11-2008 12:49 PM

Quote:

Originally Posted by Tolnaftate2004 (Post 1215705)
PHP Code:

font "verdana";
style "";
fontsize $pref::graal::defaultfontsize/gettextheight(1,font,style);
tokens wraptext2(40,fontsize," ",font "@" style "@" player.chat); 

This will most accurately split at words and fit into your space. $pref::graal::defaultfontsize is a placeholder for the height in pixels of how tall you want the text to be. Change to your liking.

That should work.

Chompy 06-11-2008 02:12 PM

uhm, put space as delimeter? :o

PHP Code:

temp.msg "Test tessst asfusaububs iasubdiubdasiub sdijb ijbbaiusbdsijbb";
temp.msg wraptext2(<width in pixels>, <zoom>, " "temp.msg); 

or something like that

Oh, and clientside only ;o


All times are GMT +2. The time now is 12:02 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.