Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dynamic gump text question.
Author Message
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #1
dynamic gump text question.
Hi guys, I need help.

I'm doing this gump.
Code:
[DIALOG d_props]
50,50
resizepic 124 44 9200 226 96//grey
gumppictiled 137 59 198 67 9274//blue
gumppictiled 138 60 70 21 3004//white1
gumppictiled 209 60 95 21 3004//white2
button 314 63 5601 5605 0 1 1 1//button
dtext 142 60 0 Item Name
dtext 220 60 0 <tag0.name>
gumppictiled 138 82 70 21 3004//white1
gumppictiled 209 82 95 21 3004//white2
dtext 142 83 0 Item ID
dtext 220 83 0 <tag0.ID>
gumppictiled 138 104 70 21 3004//white1
gumppictiled 209 104 95 21 3004//white2
dtext 142 105 0 Item Pos
dtext 220 105 0 <tag0.P>

My question is related to <tag0.name>, when the tag name is too big the text end up passing the gump limits....

its there a way to show x amount of characters on this dtext?

like
Code:
dtext <x> <y> <color> "<max number of chars>" <text>
And also how can I make a gump that stretches it size according to the values of tags.... like this name tag...

thanks
05-02-2014 05:05 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: dynamic gump text question.
if (STRLEN(<tag.bla>)> 35)
dtext x y color <strsub 0 35 <tag.bla>>
endif
05-02-2014 05:36 PM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #3
RE: dynamic gump text question.
thanks XuN, I know that for you this is a ridiculous question but it makes a big difference for me.
Btw what about the gump itself... anyway to make it dynamic too?
05-02-2014 06:22 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #4
RE: dynamic gump text question.
I use cropped text.

Code:
dcroppedtext x y width height colour text

Set the boundaries inside your gump and if it goes behind the boundaries, it hides the rest of the text. "Fades".
(This post was last modified: 05-02-2014 06:33 PM by Alaric.)
05-02-2014 06:22 PM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #5
RE: dynamic gump text question.
Thanks Alaric!
This gump section in the tutorial is so no much helpful... i got so confused.
The gump itself cannot be stretched can it?
05-02-2014 06:45 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #6
RE: dynamic gump text question.
What do you mean? Setting the gumps size acording to the longest name or so?

Or bigger spaces between letters? - This one is almost impossible, you would have to put letter by letter and change their position by x pixels.
Gump size - calculating everything makes it dynamic. Checking the longest name and evaluating the size of gump etc.
(This post was last modified: 05-02-2014 08:16 PM by Alaric.)
05-02-2014 06:58 PM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #7
RE: dynamic gump text question.
Thanks for the reply Alaric, I'm asking the second option.
Can u help me by showing an example!? thx!
05-05-2014 08:15 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #8
RE: dynamic gump text question.
The cropped text?


[dialog ddd]
0,0
resizepic 100 100 01400 670 350
dcroppedtext 115 180 150 20 100 This is a very long text and it won't go behind the boundaries.

x = 115
y = 180
x-sizeoftheblock = 150
y-sizeoftheblock = 20 (20 is height of a common text)
colour = 100


E: That probably is not what you mean, I'm lost.
I'm really trying!!! I read the whole thread like 10 times.
(This post was last modified: 05-05-2014 08:55 AM by Alaric.)
05-05-2014 08:47 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #9
RE: dynamic gump text question.
you must adjust the dialog background width/height based on your text length
almost impossible to get a 100% perfectly align since texts length may vary (both "iiiiiiiiiiiiiii" and "wwwwwwwwwwwwwww" has the same length of 15 characters). Most of times the background won't resize perfectly but it works

something like this
Code:
resizepic 0 0 100 <eval (STRLEN(<TAG.A>)/100)*20> 3000
05-05-2014 11:30 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #10
RE: dynamic gump text question.
thanks guys, tomorrow Ill try your guys suggestions.

Big Grin
05-06-2014 08:58 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)