[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 parent of another, creating a branching display tree.

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: var Circle = list.addCircle({
x: width / ,
y: height / ,
radius: ,
stroke: true,
fill: false,
rotation: [,]
}); list.addRect({
x: ,
y: ,
w: [, ],
h: ,
parent: Circle
}); }

[GIF] Parenting in GIF Loop Coder

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: var ray1 = list.addRay({
x: ,
y: height / ,
length: ,
angle: [-,]
}); var ray2 = list.addRay({
x: ,
y:,
length: ,
angle: [,-],
parent: ray1
}); var ray3 = list.addRay({
x: ,
y: ,
length: ,
angle: [-,],
parent: ray2
}) }

[GIF] Parenting in GIF Loop Coder

If you don't need the parent to show, you can use Container:

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: var parent = list.addContainer({
x: width / ,
y: height / ,
rotation: [,]
}) list.addText({
x: ,
y: ,
text: "EGGHEAD",
rotation: [,],
parent: parent
})
}

[GIF] Parenting in GIF Loop Coder

上一篇:IE10,11下_doPostBack未定义错误的解决方法


下一篇:WIN8系统安装软件时提示"扩展属性不一致"的解决方法