Asynchronous animations in LCB

David Bovill david at viral.academy
Tue May 10 06:26:54 EDT 2016


Thanks Mark - I think as an excercise adding an alarm capability to the
clock seems like a nice thing to do. Looking in to how do you dispatch
messages from LCB to LivecodeScript? I see two option "send" and "post"
wandering what the difference is...

I also have a general question about the scope and robustness at this stage
of compound widgets. As an example if I am looking to dynamically move
clickable sprites around can I do things like add a number svg icon widgets
and animate them?

It would be good to have an idea about the speed of using widgets to do
complex layouts and interactions like this - as compared with doing the
same using groups and Livecode script - in what areas would I expect to see
a speedup, and what areas would be about the same or slower for now?



On 10 May 2016 at 10:19, Mark Waddingham <mark at livecode.com> wrote:

> On 2016-05-10 10:56, David Bovill wrote:
>
>> I'm contemplating doing some animations in a widget, and would like the
>> animation to be non-blocking. How do you achieve that in LCB?
>>
>
> At the moment a widget can ask for a single shot callback 'timer' using:
>
>    schedule timer in <seconds> seconds
>
> A timer can be cancelled by using
>
>    cancel timer
>
> When a timer triggers the OnTimer handler of the widget is invoked.
>
> This is sufficient to do simple animations, indeed the clock shows a good
> example of using it:
>
>
> https://github.com/livecode/livecode/blob/develop/extensions/widgets/clock/clock.lcb
>
> Hope this helps!
>
> Mark.
>
> --
> Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list