this has been brought up 3 or 4 times in the past with not too much discussion, so i thought i'd ask: has anyone in byond created a mouseover tooltip functionality that works smoothly (like something you'd see in a flash game) and without being highly inefficient (hearsay has me believeing MouseEntered and MouseExited is basically the only way to do it but also really inefficient)?
in a previous discussion, it was mentioned that it's not really possible at all using interface elements since MouseEntered and MouseExited don't respond to those; so if you wanted mouseover tooltips in your interface you'd have to limit yourself to using an onscreen-object based HUD?
just in case anyone's not entirely sure what i'm talking about (how could byond have never had someone create this functionality for their game?): http://wowui.incgamers.com/uploads/ 1194898260-2029509400-1649783591-2.PNG
you mouse over the ore, after 0 to 1 or 2 seconds the info pops up, and if you move your mouse off it, it disappears.
so how easy/hard/impractical is this in byond?
ID:157609
Feb 3 2010, 6:09 pm
|
|
Feb 3 2010, 10:01 pm
|
|
Taking in count all the letters, it would create a lot of bandwidth, sadly we don't have client side processing =[
|
In response to Ripiz
|
|
Ripiz wrote:
Taking in count all the letters, it would create a lot of bandwidth, sadly we don't have client side processing =[ that's the most nondescript and confusing answer i have ever received |
In response to Zaole
|
|
For each created letter, server will need to send object ID, icon, icon_state, location on screen, layer and probably some other stuff. You would need like 200-300 letters for short detailed description, so I'd say that's few KBs of data.
Also I can't think of any easy way, to detect that mouse was over object for 1-2 seconds. Like 10-20 players already would make MB of data. So it's not effective at all. Surely you could try to preicon common words, like Damage, item descriptions, but it still would make a lot of bandwidth, unless you preicon A LOT of them, for every item. But it add like 10-20 megs to your resource file, depending on number of items. Client side processing: Client side (player) will do the calculation, to create letters on screen, so it saves bandwidth. |
MouseEntered/MouseExited will be a source of some overhead, but you'd have to hash out which objects would be subject to this and only define the mouse procs for those. That would be your best chance of making this as efficient as possible.
All you're doing is trading click functionality for mouseover functionality. You can always make the popup an interface element, or you can use client.screen or /images. The obj you want information on would have to be placed somewhere where MouseEntered/MouseExited would function, obviously. |
In response to tenkuu
|
|
thanks for the info. i have one question though:
tenkuu wrote: All you're doing is trading click functionality for mouseover functionality. are you saying that the screen objects that are a given a mouseover tooltip (through using mouseentered and mouseexited) would have to lose their Click() functionality? that'd be bad for my plans considering anything that would require a mouseover tooltip (such as a skill button) would involve clicking on it to "use" it |
In response to Zaole
|
|
Sorry for being a little vague. Click() will still function normally. I was just pointing out that you'd be handling the display of this info in the same way as if you could only get this info by clicking on it. Only the method of triggering it would be different. Essentially that part of my post was irrelevant. :)
|