ben_

Hi guys,
I work in a small startup company based in Germany. We are making a app for Android and iOS and want to insert animations of little monsters (a bit like in cut the rope). We are discussing now which software to use to get the best compatibility to both mobile OS. Our designer used After Effects to create the animations.
The Problem: He used Layer masks for certain Layer. The Monster is coming out of a hole and is then looking towards the user. Is there a good way to implement masks in Spine? My suggestion is that we apply a layer mask programatically to the layer where the animation is displayed. But this is not a very elegant way. Also I don't think a frame based animation is not the way to go since it costs more memory than skeleton based animations.

We are looking forward to read your answers!

Best Regards,
Benjamin
User avatar
ben_
  • Posts: 2

BinaryCats

We use bounding boxes for masks. bounding box mask out will stop anything drawing in that area, and mask in to enable drawing in side that area. Draw order is important. from top to bottom it looks like stuff we want to draw behind>mask in>maskout>stuff we want on top
User avatar
BinaryCats
  • Posts: 1299

roebot01

And where are these bounding boxes found? And the mask out?
roebot01
  • Posts: 9

BinaryCats



bare in minde, bounding boxes are not triangulated. You could use a mesh, which is triangulated instead of doing your own triangulation
User avatar
BinaryCats
  • Posts: 1299

roebot01

I managed to find it and edit them in, but I don't see how you can use it as a masking layer?
roebot01
  • Posts: 9

BinaryCats

Via code. I can go into detail of you want
User avatar
BinaryCats
  • Posts: 1299

Therazin

Hay Binary,
This would be very usefull for us too.
If you dont mind, we would be very glad if you could go into the details =D
User avatar
Therazin
  • Posts: 28

BinaryCats

(from memory) Upon drawing the skeleton, you need to listen out for the attachment/slotname.once the maskout name comes through, you need to grab the verts and triangulate. You need to then disable writing to the buffer (inside this mask). The next step is listen out for the maskin which you want to enable writing to the buffer in. then anything after that (in draw order)will be masked

In spine your draw order should be:
stuff you want to mask
maskin
maskout
stuff drawn behind mask
User avatar
BinaryCats
  • Posts: 1299

ZimM

@BinaryCats
Can you please explain it in a little more detail? How exactly are you disabling write to the buffer inside the mask?
User avatar
ZimM
  • Posts: 25

BinaryCats

It isn't in the mask. We check if the attachment matches our naming convention, and have a flag on the draw call, whether it is a mask in/ mask out/ not a mask. depending on the mask type we change the Z depth of what we draw.
User avatar
BinaryCats
  • Posts: 1299


Return to Runtimes