d2d.rendering.rectangleshape



class RectangleShape: d2d.rendering.shape.Shape, d2d.core.idisposable.IDisposable, d2d.core.iverifiable.IVerifiable;
A resizable rectangle containing a texture.

Examples:
auto rect = new RectangleShape();
rect.size = vec2(100, 50); // 100x50 px
rect.create();
window.draw(rect);

// OR

auto rect = RectangleShape.create(vec2(0, 0), vec2(100, 50)); // At 0,0 with size 100x50 px
window.draw(rect);


this();


@property bool valid();
Returns if the mesh is valid.

@property ref vec2 size();
Property for the size of the rectangle.

@property ref vec4 texCoords();
Property for begin xy and end xy using a vec4 for texture coordinates.

void create();
Creates a new mesh after disposing the old mesh.

void draw(IRenderTarget target, ShaderProgram shader = null);
Sets the current transformation matrix and draws this onto the target.

static RectangleShape create(vec2 position, vec2 size);


static RectangleShape create(Texture texture, vec2 position, vec2 size);


static RectangleShape create(Texture texture, vec2 position, vec2 size, vec4 texCoords);



Page generated by Ddoc.