SetBlend
Monkey Forums/Monkey Programming/SetBlend
| ||
Currently I see that this command does different things depending what platform its on. Any chance we can get a break down of what its should do in say Flash and html targets? Also, is there any plans to improve on this command? |
| ||
I'd love to see some extra blend modes but it's a big ask for HTML5 at the moment. (but check out context-blender on my github if you're interested) |
| ||
My perticles app (http://www.monkeycoder.co.nz/Community/topics.php?forum=1037&app_id=37) uses setblend(1), in HTML is does the lightblend as expected, on android they just look a little flat (I had to add the shininess to the sprite instead to achieve a vaguely decent effect). I had a play around in the Android source to see if I could change anything, but have yet to find a blend mode that does much. |
| ||
After a little play around, I have now managed to alter the modes available to flash. The one I was after was multiply :) |
| ||
Care to share the code changes? |
| ||
In Monkey\modules\mojo\native\mojo.flash.asinternal function SetBlend( blend:int ):int{ switch( blend ){ case 1: this.blend=BlendMode.ADD; break; default: this.blend=null; } return 0; } ...Replaced with ... internal function SetBlend( blend:int ):int{ switch( blend ){ case 1: this.blend=BlendMode.ADD; break; case 2: this.blend=BlendMode.SUBTRACT; break; case 3: this.blend=BlendMode.MULTIPLY; break; default: this.blend=null; } return 0; } Now SetBlend on the flash platform has 2 more methods of blending Other modes can be seen here |
| ||
Excellent, thanks. |