Scripting Indy3-GUI - Text Inventory GUI & Speech at Top

Started by NsMn, Sun 26/04/2009 18:05:38

Previous topic - Next topic

NsMn

Hello folks,

I was being scripting a templade for games in Indy a.t. Last Crusade style. But i discovered some functional problems with GUIs and Speech.

I start with the GUI problem. In Indy3 (and many other LA-games from that period of time), an Inventory with text description instead of inventory graphics. I could use the text directly as the inventory graphics, but they're also highlighted if the cursor moves over the text. How do I do that? With a text box?

Then the speech - I got it being displayed at the top of the screen, but i can't do it that there are two different colored Texts being displayed, like when Indy and his father are speaking at the same time. May you help me?

Thank you for your help,
NsMn

Pumaman

Your questions are a bit vague, so it's hard to know exactly what help you need.

For a text-based inventory, you could create a GUI with a List Box for example, and populate it with a list of the names of all the items that the player has in their inventory.

As for the speech -- how are you doing it at the moment?

Gilbert

I think what he meant was like the old Lucasfilm games (like MM, and Indy3 as he mentioned) which used text instead of icons to describe the inventory items.

To exactly reproduce that layout it's not that simple. Listbox is not that suitable as if you want to replicate the interface like the original games it'd be multiple columns. Furthermore, mouseover items won't be highlighted automatically in a Listbox.

I think it can be done with buttons, with you filling the contents of the buttons with text or sprites based on the items the player has, and as the original interface has scrolling in the list, you need to determine what items are being shown at an instance as well. It should be easier to use sprites, as you can set a mouseover graphics for each button to make them highlighted automatically (but still, you need to setup those mouseover graphics whenever the list is refreshed) but it's not economical when there are lots of inventory items. If you use text on the buttons you may need to use the GetAtXY() functions (for GUIs and GUI Controls) to check at every game loop that whether the cursor is over a certain button and change the corresponding text colour to signify a highlight.

Khris

I'd use a standard InvWindow and change the InvItem sprites on a mouseover (using DynamicSprites and DrawingSurface.DrawString to create the normal and highlighted sprites).
You'll need InventoryItem.GetAtScreenXY inside the rep_ex.

You could even check for the width of the string to only highlight them if the mouse is actually above the letters.

SMF spam blocked by CleanTalk