|
Cooper Conover
Registered User
Join date: 28 Jun 2006
Posts: 10
|
11-22-2006 11:12
I am trying to create a HUD that displays text dynamically using llSetText. I need to display several lines of text on the HUD. The problem is, the output from llSetText displays the first line in the expected position but the second two lines appear offset and above the first line by a considerable amount. It appears on the HUD as follows:
---------------------------------------------------------------------------- | |---------------------------------------> Fat Intake: 0 | |---------------------------------------> Cholesterol Intake: 0 | | | | | Caloric Budget: 0 | -----------------------------------------------------------------------------
*note: the "--------------------------------------->" are just used to indicate indentation
The line of code that generates the text is:
llSetText("Caloric Budget: " + (string)calories + "\nFat Intake: " + (string)fat + "\nCholesterol Intake: " + (string)cholesterol, <1,1,1>, 1);
Does anyone know why this may be happeing or have any suggestions to fix the problem?
|
|
Elsewhere Essex
Registered User
Join date: 8 Sep 2006
Posts: 50
|
11-22-2006 11:47
have you considered using XyText? ised it in several huds i've made and it's a beautiful thing. you can grab a working copy for free of a shoutcast stream info borad using all XyText for the display here. Steaming Live Audio - HQ (Mauve 75,250)it's open source and full mod more detailed intructions and code exmaples for using XyText can be found on the wiki in the library section.
|
|
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
|
11-22-2006 13:18
I've never seen anything like that. Usually the '\n' just causes the next line of text to be directly below the previous line. Is there anything unusual about the prim that the script is attached to? Like really convoluted parameters or something? Can you try putting the same llSetText on another prim to see if you can recreate the problem in a simpler environment?
|
|
Marcus Moreau
frand
Join date: 25 Dec 2004
Posts: 602
|
11-22-2006 13:22
Why is the caloric budget* line below the others? Shouldn't it be above? And why is it so far down? A screenshot would be better, if you can capture the hover text and HUD.
MM
_____________________
Marcus Moreau
Disenfranchised island owner...
"This statement is false." User #121869 or something close
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
Ideas
11-22-2006 13:25
llSetText will center the text, so any difference in line lengths will cause offsets to appear. Are there a lot of spaces or tab characters in the lines?
|
|
Cooper Conover
Registered User
Join date: 28 Jun 2006
Posts: 10
|
11-22-2006 13:52
Here is a screen shot. I removed all unecessary spaces from the strings, but it didn't seem to change much. The prim displaying the text is a tiny box, .02 x .02 x .02, is that unusual?
here is the entire script:
integer calories = 0; integer fat = 0; integer cholesterol = 0;
default { state_entry() { llSetText("Caloric Budget: " + (string)calories + "\nFat Intake: " + (string)calories + "\nCholesterol Intake: " + (string)cholesterol, <1,1,1>, 1); } }
This seems like really unusual behavior, is there just something I'm not seeing or understanding correctly?
|
|
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
|
11-22-2006 14:08
I don't see anything wrong with it. I'm currently working on a HUD that uses llSetText on prims that are .01 x .01 x .01, so I doubt that's the problem. Try making a new box prim and putting the same script on it. Maybe your prim is somehow bugged.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-22-2006 14:11
That script works fine for me with all text centered.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|