transparent panel not blocking mouse?

Posted By: Reconnoiter

transparent panel not blocking mouse? - 02/25/15 18:36

Howdy,

Why does a transparent panel not block the mouse cursor like a non-transparent panel? (I can select entities behind it which I don't want, I want only to be able to see the entities behind it)

Is there a quick fix for this?

tia
Posted By: Ch40zzC0d3r

Re: transparent panel not blocking mouse? - 02/25/15 20:07

if alpha is <= 0 it will automaticly set the INVISIBLE flag.
You can try alpha 1 or a panel with a complete transparent image (but 100% alpha in engine).
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 02/26/15 11:07

Hi Ch40zzC0d3r,

Setting alpha to 1 or to 100 not seem to have any effect here (except visually ofcourse). I have tried tga with alpha channel (32 bit) and png with alpha layer. Have also tried setting translucent flag but that made no difference.

Code:
function interface_startup()
{
  ...
  mypan.alpha = 100;
  ...
}

Posted By: MasterQ32

Re: transparent panel not blocking mouse? - 02/26/15 11:35

does your panel has a size applied or is it just set with pos_x, pos_y?
just try manually setting a size and check if the UNTOUChABLE flag is set
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 02/26/15 14:02

Just set with pos_x/pos_y. The size_x and _y are already correct (though to be certain I checked it by setting it manually). The buttons on the panel do work right and they do seem to block the mouse cursor. So its only the bmap of the panel that does not block the mouse cursor. UNTOUChABLE flag is not set.
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 03/02/15 16:14

Does someone perhaps have a working example of of a panel with a transparent bmap blocking the mouse pointer?
Posted By: Superku

Re: transparent panel not blocking mouse? - 03/02/15 17:01

As it apparently does not work you will have to find a workaround.
I suggest you create a new variable
var mouse_ent_clickable = 1;
which is set to 1 if and only if the mouse position is valid (which obviously includes being outside of the dimensions of the panel in question).

EDIT: Then use that variable in entity click events.
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 03/03/15 14:52

Hi Superku,

Yes I already have something like that for the bigger panels. I quess I could do it the hardway for the smaller ones too.
Posted By: Anonymous

Re: transparent panel not blocking mouse? - 03/04/15 17:42

When I used to work on this stuff, I would build these "hardways" into libraries like Basic_panel_behaviors.h . As you might see from my like of projects-shared, I spent more time writing and fixing libraries than creating anything.
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 03/04/15 19:00

lol, I get what you mean though. Just since a few weeks I actually feel that my workflow and the tools I have are good enough.

ps do you perhaps know how to increase the size of that ctrl+space shortcut window within SED? (the one where you can quickly select function names & vars etc. to place in your script) I want to use that one but its so damn tiny and jcl ignored me when I asked him how >>.
Posted By: Anonymous

Re: transparent panel not blocking mouse? - 03/04/15 19:10

Sorry I have no clue. I don't even have a SED to test in to spark any memories.
Posted By: Reconnoiter

Re: transparent panel not blocking mouse? - 03/04/15 19:33

ok thanks for letting me know anyway
© 2024 lite-C Forums