Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[ALLY] Re: next how-to suggestion

From: carl:cybercraft at: 21-Jun-2001 0:39

On 20-Jun-01, Rishi Oswal wrote:
> I'd like to see a how-to (on rebol website) on > animation and timing.
I think the next promised how-to is for View lists. What type of animation are you wanting to do? (I can't remember if View supports GIF anims - or if PNG has an anim format, for that matter.) Anyway, the following might give you an idea of how to control the timing. All this layout does is expand and shrink a box, but you can control its speed using the buttons. These alter the value of 'rate which controls how often 'engage is activated in the 'feel block. 'feel can be added to any styles (such as a box), allowing you to have multiple animations running at different speeds in the same layout. view layout [ size 240x270 b: box 200x200 white rate 4 feel [ engage: [ if b/size = 200x200 [b/data: -1x-1] if b/size = 1x1 [b/data: 1x1] b/size: b/size + b/data show b ] ] across button "+" 30 [ b/rate: b/rate + 1 s/text: to-string b/rate show s ] button "-" 30 [ if b/rate > 1 [ b/rate: b/rate - 1 s/text: to-string b/rate show s ] ] text "Speed: " s: text "4" 50 ]
> thanks, > rishi
-- Carl Read [carl--cybercraft--co--nz]