Ejemplo n.º 1
0
FontChar *Font::Draw(int character, float x, float y) {
    FontChar *c = GetChar(character);
    if (c != NULL) {
        c->Draw(x,y,sx,sy);
    } else {
        //printf("not found\n");
    }
    return c;
}
Ejemplo n.º 2
0
void Font::Draw(std::string str, float x, float y) {
    for(int i=0; i<str.length(); i++) {
        FontChar *c = GetChar(str.at(i));
        if (!c)	continue;

        c->Draw(x,y,sx,sy);
        x+=(c->AdvanceX() >> 6) * sx;
        y+=(c->AdvanceY() >> 6) * sy;
    }
}
Ejemplo n.º 3
0
void BitmapFont::Draw(std::string str, float x, float y) {

    for(int i=0; i<str.length(); i++) {
        FontChar *c = GetChar(str.at(i));
        if (!c)	{
            continue;
        }
        //printf("%c at %f,%f\n",str.at(i),x,y);
        c->Draw(x,y,sx,sy);
        x+=c->AdvanceX() * sx;
        //y+=c->AdvanceY();
    }
}