This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-05 05:15:04

bathar
Scratcher
Registered: 2007-11-08
Posts: 6

Variable Update Frequency for Android GUI Clone

My GUI project deals with assigning focus to a sprite (simulating a screen) however, I can't get the timing down. I would use the single step feature but my program only runs in full screen because of my click and drag implementation.

I have my scripts running with 1 second intervals to clearly define the logic switches but my goal is to have it running in real time.

Can someone explain the exact timing.

P.S. My pixel precision might be the problem but I have no way of knowing until I use exact dimensions.

http://scratch.mit.edu/projects/bathar/3020465

Last edited by bathar (2013-01-05 05:43:18)

Offline

 

#2 2013-01-05 12:02:26

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Variable Update Frequency for Android GUI Clone

You could constantly check whether the y position of one of the screens is between certain boundaries, and if so, give that screen the focus until it's out of the boundaries.

set [focus? v] to [0]
forever
    wait until <<(y position) > [-30]> and <(y position) < [30]>>
    set [focus? v] to [1]
    wait until <not <<(y position) > [-30]> and <(y position) < [30]>>>
    set [focus? v] to [0]
end


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

Board footer