Clickable textdraws
#1

Hi,

I don't know if it's possible (I guess not), but I'm gonna ask anyways.

When you have made a menu with selectable textdraws (like MSelect include), is it possible to detect on which textdraw the mouse-pointer is hovering?

This could be useful when you have a graphical inventory and when hovering over an item, you could display some extra textdraws on the side to display additional information about the item like a description.

Many games have such features (MMORPG's for example display a tooltip with a description of the item and it's stats in case of a weapon or armor piece).

Is this possible with SAMP?

In case this is not the case, maybe it's possible to highlight the chosen textdraw by changing it's background color for example and remembering which item has been selected once.
Then display the additional textdraws with extra info.
When the item is clicked again while being highlighted (this happens after 2 clicks in a row on the same item), then the item is chosen and processed.

So to select an item from your inventory, you need to double-click it and when you only want additional info about items in your inventory, you only need to click it once.

I guess this could be possible but I doubt about the first one (display extra info just by hovering over an item).

What do you guys think about this?
Reply
#2

Highlighting colour is possible I think as I've witnessed it
Reply
#3

I know that you can set a highlight color when your mouse hovers over a textdraw but I don't think there is a callback that gets called when your mouse hovers over a clickable textdraw so you can do something (like displaying a description of an item).

I think I'll make my textdraws double-clickable.

When you click on a textdraw, the background color of the textdraw could be changed to blue for example (my default background color is black) to let the player know he clicked on that item and the appropriate description and some extra info will be displayed next to the inventory area.

This is not the hover-color for textdraws. Just the basic background color for textdraws.

Then, if he clicks on another item, the new item will be changed to blue and the description and extra stats will be changed accordingly.

When he clicks a second time on the already blue-colored textdraw, the item will be selected and used (like a pizza to gain some health for example).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)