[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 12361 File Retrieval 后缀数组+并查集
题意:有F个单词,1 <= F <=60 , 长度<=10^4, 每次可以输入一个字符串,所有包含该字串的单词会形成一个集合. 问最多能形成多少个不同的集合.集合不能为空. 分析:用 ...
- SPRING IN ACTION 第4版笔记-第三章ADVANCING WIRING-007-给BEAN运行时注入值placeholder、@Value
一.用placeholder给bean运行时注入值的步骤 Spring取得placeholder的值是用${...} 1.声明placeholder bean (1)java方式 In order t ...
- Objective-c Category(类别)
NSStringUtilities.h: #import <Foundation/Foundation.h> @interface NSString(Utilities) -(BOOL) ...
- BZOJ_1180_[CROATIAN2009]_OTOCI_(LCT)
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1180 三种操作: 1.询问x,y是否连通,如果不连通,建一条边x,y 2.把x节点的权值改为t ...
- Jquery 输入金额格式限制 插件
(function($) { $.fn.extend({ money_mode: function(options) { var defaults = { decimal_length: 2,//小数 ...
- jQuery与XML
jQuery与XML 快而强的遍历系统,华丽丽的选择器语法,这或许是jQuery 那么流行的原因.当然它还有详尽的文档.它主要是用来处理HTML的,但在这里妳会看到如何应用到XML. 使用jQuery ...
- 两种应该掌握的排序方法--------1.shell Sort
先了解下什么都有什么排序算法 https://en.wikipedia.org/wiki/Sorting_algorithm http://zh.wikipedia.org/zh/%E6%8E%92% ...
- ASCII,Unicode和UTF-8
转自:http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html 今天中午,我突然想搞清楚Unicode和UTF-8之间的关 ...
- [liu yanling]测试方法
1.定义 是把所有可能的输入数据,即程序的输入域划分成若干部分(子集),然后从每一个子集中选取少数具有代表性的数据作为测试用例.该方法是一种重要的,常用的黑盒测试用例设计方法. 2.划分等价类 等价类 ...
- 【JS】Intermediate4:JSON
1. JSON(JavaScript Object Notation) A set of text formatting rules for storing and transferring data ...