I have been wondering... you know how most objects in wade have functions and properties that start with an underscore, like sprite._position.
That's right, functions that start with an underscore are not meant to be used, unless you know exactly what you're doing. In other words, they are for internal usage only. As you may have noticed, these aren't even documented, and they may change without notice in future versions of WADE.
If you want to prevent people using some functions, why make them accessible as member functions? If you made them local (function-scoped), you could still access them through a closure, but users of wade couldn't get to them.
That's right hermes, you could essentially make them "private", as they would be in another language such as C.
Makes sense, thanks for the explanation.
Good to know, I was thinking the same thing... I don't never use underscore functions, I thought they are private.
wade.drawFunctions.solidFill_ is not available in webgl mode.
How can i change this mode to 2d?
Hi echar
You have a couple of options for solidFill_
- Switch the layer's render mode to 2d. This could be done either in code
wade.setLayerRenderMode(layerId, '2d');
or in th editor, in the scene properties
: Saying that, you can also keep using WebGL and use a custom shader to achieve the same effect (though this obviously won't work on systems where WebGL is not supported). Again, this can be done in code
mySprite.setPixelShader('gl_FragColor=vec4(1.,0.,0.,1.);');
or in the editor (in the sprite editor tab):