import Texture from "../textures/Texture"; import Mesh from "./Mesh"; import DisplayObject from "./DisplayObject"; import Rectangle from "openfl/geom/Rectangle"; import Point from "openfl/geom/Point"; declare namespace starling.display { /** * A Quad represents a colored and/or textured rectangle. * * * *
Quads may have a color and a texture. When assigning a texture, the colors of the * * vertices will "tint" the texture, i.e. the vertex color will be multiplied with the color * * of the texture at the same position. That's why the default color of a quad is pure white: * * tinting with white does not change the texture color (that's a multiplication with one).
* * * *A quad is, by definition, always rectangular. The basic quad class will always contain * * exactly four vertices, arranged like this:
* * * ** * 0 - 1 * * | / | * * 2 - 3 * ** * * *
You can set the color of each vertex individually; and since the colors will smoothly * * fade into each other over the area of the quad, you can use this to create simple linear * * color gradients (e.g. by assigning one color to vertices 0 and 1 and another to vertices * * 2 and 3).
* * * *However, note that the number of vertices may be different in subclasses.
* * Check the property numVertices if you are unsure.