text windows and message locations

Started by Nixxon, Fri 30/05/2003 15:50:35

Previous topic - Next topic

Nixxon

Hail, when i inspect my inventory items i want a larger image to appear on screen with text under it. perfectly alligned in the middle of the screen.
eg.

======
=image=
======
text text
text text


I was thinking the image could be a GUI (could easily place that where i want), as for the text under it if i use DisplayAt it comes up as windowed text... with white behind it.

i know i can use a GUI as a window background and make the back and fore ground colours "0" so the actuall window would be 100% trasnparent and the text would be defined where i want it.
How do i do this?
I've made the GUI text window but in-game it's still plain old white.

OR -

is there an easier way all together?

Thanks, i love u all  8)

Timosity

You could use a gui with just the background image being the inventory item and use

DisplaySpeechAt (int x, int y, int width, CHARID, string message)

or

I just tested this way, have a GUI with a button at the top, which you change the image to the inventory item, add a gui label below the image in the alignment that you want and put the description there.

don't click the "text window" option box, set it to script only, set the foreground and background to 0 and it works as far as I can see.

Nixxon

#2
thanks! :D I used the second method, it looks wonderfull
i had to use 2 GUI labels, i pasted the whol description in 1 and AGS crashed, must be a limit on how much text a GUI label can hold.
anyway i've lined 2 up perfectly :D

Am I able to have this new GUI dissapear with a mouse click (much like regular player text)?

thanks again :)

EDIT -

tried this to no avail

if (interface == 6) {
if (button==LEFT)
GUIOff(6);

Am i on the right track?

Proskrito

#3
i assume that you areputting that code in "interface_click" function.
So, i think you should put in "on_mouse_click()" the following:

function on_mouse_click(int button) {
if (isGUIOn(6)==1 && button==LEFT) GUIOff(6);
if (button==LEFT) {
blah blah blah

I hope this works.

Nixxon

#4
Yep works, only prob is, since the GUI takes up most of the screen, i have to click outside the GUI... which is a very little portion of the screen.
any way to overcome this?

EDIT -
ok untick clickable. arent i a silly boy :P

Works great now, thanks for everything :D :D

SMF spam blocked by CleanTalk