Page 1 of 1

Flickerless Textobject, how?

Posted: Thu Jul 12, 2012 10:33 pm
by fingus
This demonstration shows that textobjects are flickering when updated like this:

Code: Select all

    EnableLayers()
    SetFont(#SANS,60)

	Function p_main()
    CreateTextObject(1, GetTime(True))
	Undo(#TEXTOBJECT,1,1)
	DisplayTextObject(1, 0, 0)
    EndFunction

    SetInterval(1, p_main, 1000/50)	; 50 fps

Repeat
	WaitEvent
Forever            
i also tried:

Code: Select all

AddMove(1 ,#TEXTOBJECT, 1, 0, 0)  
DoMove(1)
    	ClearMove(1)   
But its flickering too! whats wrong?

Re: Flickerless Textobject, how?

Posted: Fri Jul 13, 2012 11:15 am
by airsoftsoftwair
Use SetLayerStyle() with the "Text" attribute to change the text of an existing layer. If you don't want to use layers, draw to an offscreen brush first and then bring this offscreen brush to the screen with just a single call to DisplayBrush().