Draw Text

Text.png

A) As displayObject:

bool TextDraw::Draw(Direct2DContext* ctx, D2D1::Matrix3x2F* mtx) {
    ctx->SetFillStyle(0, 0, 1);

    ctx->fillText("Hello World", 0, 0);
return true; }
TextDraw* textDraw = new TextDraw();
_stage->addChild(textDraw);

B) As state object:

    Shape* textShape = new Shape();

    textShape->graphics.fillText("Hello World", 0, 0);
_stage->addChild(textShape);

C) As Text object:

#include Objects\Text.h

Text* text = new Text();
text->SetText("Hello World");
_stage->addChild(text);

Last edited Mar 27, 2013 at 8:57 PM by TypeOverride, version 6

Comments

No comments yet.