Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rui 'Trovatore' Pires on Wed 08/12/2004 12:38:34

Title: List box suggestion
Post by: Rui 'Trovatore' Pires on Wed 08/12/2004 12:38:34
I'd like to ask for the ability to choose the color of the texts in listboxes (already in), the color of the selected text (already in) and the color of the highlight around the text (not in - currently that is the SAME color of non-highlit text).

It's for a template.

EDIT - BTW, how about the possibility of making only the background image of any given GUI transparent? I know it can be worked around with overlays, but with sereval such GUIs on at the same time the overlays take their toll on the game, PLUS with the limit of 10 overlays I'm always afraid of hitting the limit.

EDIT 2 - Another thing - some sort of ListBoxGetTopItem function should be added. Otherwise, how can we possibly, say, scroll a save game list up and down with our own coding? (if I'm wrong and someone can tell me how to make it, I'd be much obliged)
Title: Re: List box suggestion
Post by: Pumaman on Wed 08/12/2004 19:44:33
Quotethe color of the highlight around the text (not in - currently that is the SAME color of non-highlit text).

Way ahead of you ;)
http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=184

QuoteEDIT - BTW, how about the possibility of making only the background image of any given GUI transparent?

I'm not sure what you mean here ... the background image can already be transparent.

QuoteEDIT 2 - Another thing - some sort of ListBoxGetTopItem function should be added.

Aye, this has already been requested. For now, you have to save the top item in a variable when you call ListBoxSetTopITem.
Title: Re: List box suggestion
Post by: Rui 'Trovatore' Pires on Wed 08/12/2004 22:46:23
QuoteI'm not sure what you mean here ... the background image can already be transparent.
Well, what I mean is, like, to have a transparent background image in a GUI but solid buttons and labels. Currently I'm using GUI transparency, but obviously that's not it (EVERYTHING gets transparent). If there IS a way to do it... well, I DID rtfm, but I don't remember seeing it there... ::)

As for the rest... sorry, I just hardly ever bother checking the tracker... it's so full of stuff already I doubt I'd find anything if I went looking for it. :P At any rate, I raised awareness of those points, I guess... ;D
Title: Re: List box suggestion
Post by: Pumaman on Wed 08/12/2004 22:54:10
Oh, you mean that kind of transparency. I kinda wish I'd called the SetGUITransparency-type stuff Translucency instead, because transparency also refers to the ability to merely have see-through pixels.

The problem with your request is that the GUI image is constructed off-screen, and then drawn to the screen with the specified transparency level, so it's not really possible to do. If you're using 32-bit colour, you could import an alpha-channeled image to accomplish this, however.
Title: Re: List box suggestion
Post by: Rui 'Trovatore' Pires on Wed 08/12/2004 22:56:45
Ah, ok. Ah well, nevermind then. Thanks for the attention and prompt response, as usual. ;)
Title: Re: List box suggestion
Post by: RickJ on Thu 09/12/2004 00:31:11
Just out of curiosity, could this be accomplished by using 2 GUIs;  one with the buttons and a transparent image and the other with the translucent background image?

Title: Re: List box suggestion
Post by: Rui 'Trovatore' Pires on Thu 09/12/2004 09:29:49
I tried that once, but with a PopUp thingie it don't work properly. If I set up the 1st one's MouseYPos, the other one never gets up because the game gets paused. If I put on repeatedly_execute_always some check that says that whenever ONE is on, the other MUST be on too, the other turns on one noticeable split second too late.

I haven't yet tried calling them up BOTH at the same time, though, honestly. That might work, but since I'm already working with many GUIs, I don't want to get confused...

EDIT - Yeah, that latter method works great, RickJ.

CJ, one more thing - how about some way to return the list box index the mouse is currently over with? WOuld that be somehow possible?
Title: Re: List box suggestion
Post by: Gilbert on Fri 10/12/2004 08:41:30
Quote from: Rui "Puss in Boots" Pires on Thu 09/12/2004 09:29:49
CJ, one more thing - how about some way to return the list box index the mouse is currently over with? WOuld that be somehow possible?

I'm not sure but I think it's not directly possible at the moment. I can think of a (slightly complicated) workaround though. That is, calculate what should the item be via checking the mouse's coordinates VS the list boxes' coordinates (not tested).
Say, here are the information you know:
GUINUM - the GUI number with the listbox
LISTNUM - the object number of the box within the GUI
LISTY - y-coordinate of the top of listbox
LINEWIDTH - how tall a line of text is in the box
listtop - variable holding the current top item number

I think the following codes may help save the mouseover item number to variable overitem (you'll need proper variable declarations and may need some tweakings):

mx=mouse.x;my=mouse.y;
overitem=-1; //nothing initiallty
if (GetGUIAt(mx,my)==GUINUM){
Ã,  if (GetGUIObjectAt(mx,my)=LISTNUM){ //if over listbox
Ã,  Ã,  temp=listtop+(my-LISTY)/LINEWIDTH;
Ã,  Ã, if (temp<ListBoxGetNumItems(GUINUM,LISTNUM)) overitem=temp;
Ã,  }
}


EDIT by f00: Heh the f00l who wrote this post accidentally striped everything from the quotes away, leaving an empty qoute. Luckily it's still readible...
Title: Re: List box suggestion
Post by: Rui 'Trovatore' Pires on Fri 10/12/2004 09:05:03
<whistle> That's quite a mouthful, Gilbot. Thanks, I'll experiment with it when I can (although I still vote for this being added to AGS ::) ).
Title: Re: List box suggestion
Post by: Pumaman on Fri 10/12/2004 09:49:55
Ok, well I'm revamping the listbox anyway as part of the 2.7 upgrade work, so I'll see about adding it then.