extended by Anim, Bitmap, Graphics, Interactive, Particles, SpriteBatch, Text, TileGroup, Video
A base class for all 2D objects that will draw something on the screen.
Unlike Object base class, all properties of Drawable only apply to the current object and are not inherited by its children.
The color multiplier for the drawable. Can be used to adjust individually each of the four channels R,G,B,A (default [1,1,1,1])
Setting colorAdd will add the amount of color of each channel R,G,B,A to the object pixels.
Setting a colorKey color value will discard all pixels that have this exact color in the tile.
Setting a colorMatrix will apply a color transformation. See also
By enabling smoothing, scaling the object up or down will use hardware bilinear filtering resulting in a less crisp aspect.
By default smooth is
null in which case
Scene.defaultSmooth value is used.
Enables texture uv wrap for this Drawable, causing tiles with uv exceeding the texture size to repeat instead of clamping on edges.
tileWrap does not use the
Tile region as a wrapping area but instead uses underlying
This is due to implementation specifics, as it just sets the
Texture.wrap to either
Because of that, proper Tile tiling can be expected only when the tile covers an entire Texture area.
Add a shader to the drawable shaders.
Keep in mind, that as stated before, drawable children do not inherit Drawable properties, which includes shaders.
Drawable.colorMatrix value by specifying which effects to apply.
adjustColor() without arguments will reset the colorMatrix to
getDebugShaderCode(toHxsl:Bool = true):String
Returns the built shader code, can be used for debugging shader assembly
Whether return an HXSL shader or the native shading language of the backend.
Returns the first shader of the given shader class among the drawable shaders.
The class of the shader to look up.
Returns an iterator of all drawable shaders