Announcement

Collapse
No announcement yet.

Serial API: How to constrain a string to a clip rect?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serial API: How to constrain a string to a clip rect?

    On a u70LCD-DT (800x480) I do the following:
    Display.gfx_MoveTo(750, 100); // near the RH edge of the screen
    Display.putstr("This string is wider than 50px");
    and it causes the string to draw to the edge of the screen then wrap to a 2nd line which also begins at x=750

    What I want to do is have the string NOT wrap but instead have the portion >800px be not shown.

    I'm finding that when I do this:
    Display.gfx_Clipping(1);
    Display.gfx_ClipWindow(750, 100, 799, 120);
    Display.gfx_MoveTo(750, 100);
    Display.putstr("This string would wrap without clipping");
    that NONE of the text is displayed.

    Any ideas?

    Thanks,
    -Dave

  • #2
    Hi Dave

    Using this command txt_Set(TEXT_WRAP, n); were 0 is off or n = the pixel position where text wrap will occur at RHS.

    I hope this helps

    Paul.

    Comment

    Working...
    X