Previous, we animate the item by passing an array to tell the start position and end position.

To make thing more interesting, we actually can pass the function instead of array.

function onGLC(glc) {
glc.loop();
// glc.size(400, 400);
// glc.setDuration(5);
// glc.setFPS(20);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color; // your code goes here: list.addCircle({
x: function(t){
return + Math.cos(t * Math.PI * ) * ;
},
y: function(t){
return + Math.sin(t * Math.PI * ) * ;
},
radius :
})
}

Create Multi circle by for loop:

function onGLC(glc) {
glc.loop();
// glc.size(400, 400);
// glc.setDuration(5);
// glc.setFPS(20);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color; // your code goes here: for(var i = ; i < ; i += ){
list.addCircle({
x: function(t){
return + Math.cos(t * Math.PI * ) * ;
},
y: function(t){
return + Math.sin(t * Math.PI * ) * ;
},
radius :,
phase: i /
})
} }

To make thing even more interesting, we can set different x and y start point:

function onGLC(glc) {
glc.loop();
// glc.size(400, 400);
// glc.setDuration(5);
// glc.setFPS(20);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color; // your code goes here: for(var i = ; i < ; i += ){
list.addCircle({
thisI: i, // custom prop to save i
x: function(t){
return this.thisI + Math.cos(t * Math.PI * ) * ;
},
y: function(t){
return this.thisI + Math.sin(t * Math.PI * ) * ;
},
radius :,
phase: i /
})
} }

We create 'thisI' to save i for addCircle to avoid common javascript problem.

[GIF] GIF Loop Coder - Animation Functions的更多相关文章

  1. [GIF] GIF Loop Coder - Interpolation

    This video discusses the default interpolation in GIF Loop Coder, and four distinct ways to change t ...

  2. [GIF] GIF Loop Coder - Introduction

    Introducing the program, GIF Loop Coder, which allows you to make looping animated gifs (and other t ...

  3. [GIF] The Phase Property in GIF Loop Coder

    In this lesson, we look at one of the most powerful features in GIF Loop Coder, the phase property, ...

  4. [GIF] Shape Objects in GIF Loop Coder

    This lesson is a quick tour of the predefined shape objects in GIF Loop Coder. function onGLC(glc) { ...

  5. [GIF] Colors in GIF Loop Coder

    In this lesson we cover the different methods for defining and animating colors in GIF Loop Coder. f ...

  6. [GIF] GIF Loop Coder Single Mode

    We'll take a look at Single Mode animations and strategies for making this type of animation smoothl ...

  7. [GIF] GIF Loop Coder - Animating with Arrays

    In this lesson, we discuss animating using arrays, and how different data types are interpolated whi ...

  8. [GIF] Parenting in GIF Loop Coder

    In this lesson, we look at how you can build up complex animations by assigning one shape as the par ...

  9. Framework for Graphics Animation and Compositing Operations

    FIELD OF THE DISCLOSURE The subject matter of the present disclosure relates to a framework for hand ...

随机推荐

  1. H2O与Java线程同步

    Java 5以前的线程同步采用syncronized和wait,notify,notifyAll来实现,比较粗糙.之后有了Lock和Condition.ReentrantLock的简单lock,unl ...

  2. ANDROID_MARS学习笔记_S01原始版_006_ListView

    一.代码1.xml(1)main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayo ...

  3. QT做界面真是绝美,并且还可嵌入HTML与JS做界面(许多案例)

    1. 这年头想要酷炫, 还是用web最方便, QT自带嵌入式webkit, 然后用d3.js D3.js - Data-Driven Documents什么的, 各种酷炫的互动表随手而来.这里有各种各 ...

  4. TCP 协议如何保证可靠传输

    一.综述 1.确认和重传:接收方收到报文就会确认,发送方发送一段时间后没有收到确认就重传. 2.数据校验 3.数据合理分片和排序: UDP:IP数据报大于1500字节,大于MTU.这个时候发送方IP层 ...

  5. Wzplayer C++ 版本,WzplayerPro

    WzplayerPro 是Wzplayer的C++版本,新版本支持插件解码器加载等等功能,以上是预览界面. 将会与Wzplayer一样,支持更多的平台,而且WzPlayer在初始化方面将会更快. 联系 ...

  6. git workflow 原文 以及缺点

    原文链接 http://nvie.com/posts/a-successful-git-branching-model/ 有人发现git work flow的缺点,历史提交会变得混乱 http://e ...

  7. C#中的异常处理

    C#中的异常处理 while (ex != null) { WriteExceptionLog(ex, fileName); ex = ex.InnerException; } /// <sum ...

  8. mapreduce实现全局排序

    直接附代码,说明都在源码里了. package com.hadoop.totalsort; import java.io.IOException; import java.util.ArrayList ...

  9. c语言时间库函数#include<time.h>

    日期与时间函数<time.h> 头文件<time.h>中说明了一些用于处理日期和时间的类型和函数.其中的一部分函数用于处理当地时间,因为时区等原因,当地时间与日历时间可能不相同 ...

  10. Xcode6 运行程序后,右侧Debug区域的Memory显示空白解决方法

    http://chenyh-blog.com/%E8%9B%8B%E7%96%BC%E7%9A%84%E5%86%85%E5%AD%98-%E7%AC%AC%E4%B8%89%E7%AF%87-sdw ...