[GIF] GIF Loop Coder - Animation Functions
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的更多相关文章
- [GIF] GIF Loop Coder - Interpolation
This video discusses the default interpolation in GIF Loop Coder, and four distinct ways to change t ...
- [GIF] GIF Loop Coder - Introduction
Introducing the program, GIF Loop Coder, which allows you to make looping animated gifs (and other t ...
- [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, ...
- [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) { ...
- [GIF] Colors in GIF Loop Coder
In this lesson we cover the different methods for defining and animating colors in GIF Loop Coder. f ...
- [GIF] GIF Loop Coder Single Mode
We'll take a look at Single Mode animations and strategies for making this type of animation smoothl ...
- [GIF] GIF Loop Coder - Animating with Arrays
In this lesson, we discuss animating using arrays, and how different data types are interpolated whi ...
- [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 ...
- Framework for Graphics Animation and Compositing Operations
FIELD OF THE DISCLOSURE The subject matter of the present disclosure relates to a framework for hand ...
随机推荐
- UVA 515 King
差分约束系统的第一个题目,看了落花大神的博客后,对差分约束有了一定了解,关键在于建图,然后就是判断是否存在负权回路. 关于差分约束系统的解释详见维基百科:http://zh.wikipedia.org ...
- solr的原子更新/局部更新
solr支持三种类型的原子更新: set - to set a field. add - to add to a multi-valued field. inc - to increment a fi ...
- dojo.hitch 原理
在使用dojo的时候,遇到dojo.hitch这个函数 ,官方文档说的很清楚,将函数和作用域绑定起来,这让我想起了call和apply这两个函数,call和apply用于改变一个方法的执行上下文,JS ...
- 匿名函数和Lambda表达式
这个题目有点牵强,真不知道如何取一个比较中意的名称,写技术博客,我很少拘泥小节,但是注重细节,如果细节都出现问题了,那么这个博文也就失去了价值. 其实应该从委托说起,委托是C#中的一个重要的内容,记得 ...
- ActionBar官方教程(8)ShareActionProvider与自定义操作项提供器
Adding an Action Provider Similar to an action view, an action provider replaces an action button wi ...
- 注意EntityFramework.extended中的坑
EntityFramework.extended 的好处就不用多说了 详情:https://github.com/loresoft/EntityFramework.Extended 但是使用时还是要注 ...
- 六月计划#1A(6.1-6.8)
5/35 数学 BZOJ_[HNOI2008]_Cards_(置换+Burnside引理+乘法逆元+费马小定理+快速幂) BZOJ_1005_ [HNOI2008]_明明的烦恼_(组合数学+purfe ...
- BZOJ_1084_[SCOI2005]_最大子矩阵_(动态规划)
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1084 给出一个n*m的矩阵,其中m<=2,取k个子矩阵,求最大子矩阵和. 分析 1.m= ...
- 【转】Mac QQ截图保存在哪里?
原文网址:http://www.pc6.com/edu/67677.html QQ Mac版的截屏图片保存在哪儿呢?可不可以像Windows版本一样设定保存路径呢?当然是可定的.Mac QQ截图保存你 ...
- 【转】“/usr/bin/ld: cannot find -lz”
原文网址:http://stackoverflow.com/questions/3373995/usr-bin-ld-cannot-find-lz I am trying to compile And ...