Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Layer Masking
#2
Hi!

Short answer: the feature of per-pixel masking of sprites isn't available. But I can suggest a method to get the effect you want with currently available features.

Tilengine renders elements in the following order, using painter's algorithm. Objects drawn first get overdrawn by objects drawn later.

1. Regular layers
2. Regular sprites
3. Layers (or individual tiles) with priority flag set
4. Sprites with priority flag set

In your case, what you want is:

1. A regular layer with the checkerboard
2. Regular sprites for the piece shadows
3. A high priority layer with the the black, outside part of the checkerboard that will cover only the shadows that lie outside of the board
4. High priority sprites for the chess pieces, that won't be covered by the outside black background.

Check the funcions TLN_SetLayerPriority and TLN_EnableSpriteFlag with FLAG_PRIORITY

With this approach you will have the shadows always below the chess pieces and hidden outside of the board, but the pieces themselves will stand out outside of the board.

Let me know if this works for you!
Reply


Messages In This Thread
Layer Masking - by sputnikus - 03-09-2025, 04:59 AM
RE: Layer Masking - by megamarc - 03-09-2025, 08:57 AM
RE: Layer Masking - by System64 - 03-09-2025, 09:59 AM
RE: Layer Masking - by sputnikus - 03-09-2025, 11:21 PM
RE: Layer Masking - by System64 - 03-10-2025, 02:52 AM
RE: Layer Masking - by megamarc - 03-11-2025, 05:29 AM
RE: Layer Masking - by sputnikus - 03-11-2025, 07:50 AM
RE: Layer Masking - by megamarc - 03-13-2025, 04:53 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)