Problem with partial upd .. function, please help.

Hello.

I'm sorry to start another thread for OnPartialUpdate.

I know there is a lot on the forum, but I have not found a solution and an example that would solve my problem.

I will try to describe here what I need to call regularly via this function.

I have five slashes that I created in the font maker.

These slashes appear to me instead of seconds, ie 1 slash = first second.

It is like
"Knight Rider Car" reads slashes from left to right in seconds. Wink

The problem is that when I do dc.setClip at the bottom of the screen for slash size, width, height, I get to total time fast.


I would ask someone who could help me with this feature.

The best example of how to proceed.


Here's what I'm trying to do in OnPartialUpdate.

I do dcClearClip in OnUpdate...

Thank you

function onPartialUpdate(dc){
		sleepMode = true;

		
		
		dc.setClip(20, 175, 25, 20);
        dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT);
        dc.drawText(20, 175, $.fontIcon_seconds, $.ICON_SECONDS, Gfx.TEXT_JUSTIFY_CENTER);
    	 
 
    	
        }
         }

  • solved.

    I didn't have OnUpdate
    dc.clearClip ();

  • You need clerClip() only if you called setClip() so if you call clearClip() in DrawSlash is enough

  • Your code works, but it doesn't keep my slash colors as it was in the video.

    OnUpdate = normal
  • probably you don't see all slashes but they increment each second

    where is OPU and DrawSlash?

  • function onUpdate(dc) {
        	if(dc has :setAntiAlias) {
    			dc.setAntiAlias(true);
    		
    		
    		}
    		
            
           
            View.onUpdate(dc);
             var sec_now = Sys.getClockTime().sec;
             DrawSlash(dc, sec_now -1);
           
           
          
           
        
        }

  • I have the OnPartialUpdate function ready, thank you.

    Now I'm trying the same code used in OnUpdate because I have unnecessarily long code for this feature

  • try it, I haven't tested it

    var sec_now = Sys.getClockTime().sec +60;

    for(var i=0;i<7;i++)

    {

    DrawSlash(dc, sec_now -i);

    }

  • it's acting weird :-)

  • var sec_now = Sys.getClockTime().sec +59;

    for(var i=0;i<10;i++)

    {

    DrawSlash(dc, sec_now -i);

    }

  • but it can play with opu so ratherb should be

    var sec_now = Sys.getClockTime().sec + 51;

    for(var i=0;i<10;i++)

    {

    DrawSlash(dc, sec_now + i);

    }