Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Lion on September 15, 2009, 05:20:13 PM

Title: Problem with code: var actObj = Game.ActiveObject;
Post by: Lion on September 15, 2009, 05:20:13 PM
I have an object bench with holes between slats.
The program changes the form of cursor depending on a hit between slats.
How to do that a code:

var actObj = Game.ActiveObject;

was returned by an object bench, even if a cursor will be between slats?

I draw between slats a color with alpha. But alpha for png file necessary to do more than 50%.
And it does not apply.

How to do that places was not it visible between slats, but a code:

var actObj = Game.ActiveObject;

in these places worked as on an object?
Title: Re: Problem with code: var actObj = Game.ActiveObject;
Post by: Mnemonic on September 15, 2009, 07:55:06 PM
You have two options. Either create a sprite for your bench image, and uncheck the "pixel precise" check-box in SpriteEdit. Then the entire rectangle of the image will become interactive.
The other way is creating a region entity on top of your graphics, and edit the region into a shape which approximately covers the bench.
Title: Re: Problem with code: var actObj = Game.ActiveObject;
Post by: Lion on September 16, 2009, 09:05:47 AM
Thanks!

Is it possible to reduce the operation threshold (png file):

var actObj = Game.ActiveObject;

on alpha to 1%?
Title: Re: Problem with code: var actObj = Game.ActiveObject;
Post by: Mnemonic on September 16, 2009, 09:14:31 AM
No, everything with more than 50% transparency is considered totally transparent and such pixels are ignored when picking active object.