blendMode = BLEND_ADD

i am using -Dv2 and the latest Version of openfl from haxelib.
I noticed that setting

sprite.blendmode = BLEND_ADD

Dies not work in c++ targets. But with tilesheets TILE_BLEND_ADD works.
Can i get addative blending in c++ targets without tilesheets?


The corresponding blendmode variable for display objects, or the sprite you are trying to modify, is under the BlendMode class.
first put

import openfl.display.BlendMode;

at the start of your file to include that class, then use

sprite.blendMode = BlendMode.ADD;

to set it’s blendmode to additive.
See for other blendmodes.

For flash target, you can set the blend mode directly using string, for example

sprite.blendMode = "add";


I am sorry, I was not clear in my original post. What you describe,TommyXXX, is exactly what I am doing. And it compiles and works fine on flash.
But on c++ targets (android, linux) it compiles, but does not use the blend mode. I can not get BlendMode.ADD to work on c++ targets, and I am wondering if there is a possibility to get it working.

To reproduce add the line

        bitmap.blendMode = openfl.display.BlendMode.ADD;

after line 17 in the DisplayingABitmap openfl example (after the line where the bitmap is created).
When compiling to flash, the display is completely white (which makes sense, adding to the white background does not change anything). But for linux or android the result is as if the blend mode was not added.