PDA

View Full Version : SpriteAt() and transparency of sprites question


zehlein
03-28-2008, 11:31 PM
I attached a PPL code to illustrate my problem with the SpriteAt() function.

If you run the code four rectangles and a circle are created and displayed on the screen. If you click on a sprite it's color changes. The circle sprite has some transparent area surrounding the circle. (It's bigger than it has to be to show the effect in question better)
There seems to be no way, to have the SpriteAt() function working in the way that only visible parts of the circle sprite are considered during the calculation which sprite was clicked. Unfortunately this would be exactly the way I would expect SpritAt() to work. The transparent areas of a sprite are set to transparency because I don't care about them and I don'T want them to be processed by SpriteAt().
The TileEngine I'm working on produces lots of overlapping transparent areas due to the isometric view on the world it diplayes and selecting single tiles/sprites gets pretty hard if not impossible if they are not at the topmost z-order. Is there any thing that could be done about it?

zehlein
03-28-2008, 11:36 PM
Forgot to attach the code, second try...[br]1206747362_30_FT9255_spritat_test.zip

kornalius
03-29-2008, 12:04 AM
Use SO_PIXELCHECK on the sprite that has transparency. It will only check on pixels that are not transparent.

zehlein
03-29-2008, 11:57 AM
I always knew PPL rocks! :-)

... working now. Thx!