Flickerless Textobject, how?

Discuss any general programming issues here
Post Reply
User avatar
fingus
Posts: 271
Joined: Fri Sep 16, 2011 9:53 am

Flickerless Textobject, how?

Post 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?
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Flickerless Textobject, how?

Post 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().
Post Reply