Shop OBEX P1 Docs P2 Docs Learn Events
TV_Text Question — Parallax Forums

TV_Text Question

PhilldapillPhilldapill Posts: 1,283
edited 2008-01-07 19:43 in Propeller 1
I'm working with the TV_Text object. I've made simple custom made menus that are printed to the screen and are updated when the use gives input. My problem is that whenever I need to update the menu, I use TV.out($00) to clear the screen, and then reprint my menu. It·works fine, except for the little flicker each time it repaints the screen. Any way around this so that it makes a smooth transitioneach repaint? I'm thinking possibly making a "buffer" array·that is TV.cols x TV.rows long in which I can write everything to in one pass, then paint it in one quick pass instead of line by line, or character by character. Anyone know of a better way?

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-01-07 12:38
    Oh, one more thing. Is there any way to print characters underlined?(I don't think so since there is only one font on the prop...)
  • simonlsimonl Posts: 866
    edited 2008-01-07 12:55
    I can't answer your question directly, but I wonder if PhiPi's TV_WText object might be useful? You'll find it at the bottom of the post at http://forums.parallax.com/showthread.php?p=590631, and it enables you to say where the 'cursor' should be before 'printing' characters. It also enables overlapping 'windows' too!

    <Edit>
    It's pretty-much a drop-in for TV_Text wink.gif
    </Edit>

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
  • RaymanRayman Posts: 14,223
    edited 2008-01-07 13:30
    You could try monitoring the "tv_status" variable and updating the screen when invisible. Also, double-buffering, as you proposed, is probably the way to go to reduce flicker. Just make a replica of the "screen" array, write to it instead and then copy all at once... If you look at one of the demos, you can see they underline characters of a button by printing a line directly below the character you want underlined...
  • hippyhippy Posts: 1,981
    edited 2008-01-07 18:26
    I think the easiest thing to do is to make your own copy of TV_Text, edit it to add any methods you want and change things you don't like - for example, writing to the last character of the last row forces a scroll which isn't desirable if you want to use all rows full width and no blank line at the bottom.

    I've had no problems with using tv.out($01) which puts cursor at the top left without clearing the screen and overwriting what already exists. Add your own method and you can set exactly where to write to.
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-07 19:43
    Sure, that's howe MPE_TEXT came into existence. TV_TEXT is an extremelx simple object, that ecerybody is able to understand and to change. No need to understand lot of TV (just the interface).
    "Home" and overwriting will be the recommended way to avoid flicker. You should modify action of 13 ("CR") to delete the rest of the line (do it siilar as the TAB-action woks). I did that some months ago, but it seems it has vanished from my posted MPE_TEXT somehow ... funny..
Sign In or Register to comment.