Exemplo n.º 1
0
int main()
{
  PString *p = initializeString(30);
  strcpy(p->chars, "Hello");
  printf("%d\n", p->length(p));
  return 0;
}
Exemplo n.º 2
0
HScrollEffect::HScrollEffect(Display& display, const Font& font, const PString& text, bool blankAtEnd = true)
    : TextEffect(display, font, text), blankAtEnd(blankAtEnd), pos(0), charCol(0) {
    // The length, including the blank space at the end (if requested)
    maxPos = blankAtEnd ? text.length() + 1 : text.length();
    glyph_width = font.char_width(text[pos]);
}