I was trying to create new canvas HUD for airplane when I encountered a problem. Basically I tried to do some mask-like operations using blending. Unfortunately I can't make it work at all.
Here's a picture of it:
and code for bottom text and square:
- Code: Select all
var t2 = me.grp.createChild("text")
.set("blend-source", "one")
.set("blend-destination", "one")
.setTranslation(-512, 256)
.setColor(0, 1, 0, 0.5)
.setFontSize(72)
.setText("SAMPLE 2")
.show();
- Code: Select all
var tmp2 = me.grp.createChild("path")
.set("blend-source", "one")
.set("blend-destination", "one")
.setColor(0, 1, 0, 0.5)
.setColorFill(0, 1, 0, 0.5)
.moveTo(0, 200)
.horiz(128)
.vert(128)
.horiz(-128)
.vert(-128)
.show();
background is half transparent, red canvas texture. Top figures (text, square and image) have blending set for one-zero and it looks ok - colors are replaced with new ones as they should. Bottom figures have one-one - both text and image colors are mixed ok. The square on the other hand doesn't seem to be affected by any blending operations. So my question is am I missing something or am I doing something wrong?
Cheers
Marcin