博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[GIF] Parenting in GIF Loop Coder
阅读量:5065 次
发布时间:2019-06-12

本文共 2040 字,大约阅读时间需要 6 分钟。

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 / 2,        y: height / 2,        radius: 150,        stroke: true,        fill: false,        rotation: [0,360]    });        list.addRect({        x: 150,        y: 0,        w: [0, 100],        h: 40,        parent: Circle    });    }

 

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

 

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 / 2,        y: height / 2,        rotation: [0,360]    })        list.addText({        x: 150,        y: 0,        text: "EGGHEAD",        rotation: [360,0],        parent: parent    })}

转载于:https://www.cnblogs.com/Answer1215/p/5716310.html

你可能感兴趣的文章
hdu1007 Quoit Design
查看>>
0909编译原理
查看>>
Linux内核中的双向链表struct list_head
查看>>
alchemy-2.0 make出错
查看>>
样式加载顺序
查看>>
将 SharePoint 网站另存为模板
查看>>
H5 视频作为背景 source src改变后 循环播放的问题笔记
查看>>
git教程 入门
查看>>
erlang-jiffy 安装手记
查看>>
javascript实现页面滚屏效果
查看>>
[Linux]非常方便的上传下载文件工具rz和sz
查看>>
Locust性能测试_百度案例
查看>>
Struts2源码浅析-ResultType
查看>>
apply的理解和数组降维
查看>>
django-rest-framework
查看>>
git的安装和常用命令
查看>>
JS 定义变量
查看>>
JumpServer里的sftp功能报错说明
查看>>
Model/ModelMap 和 ModelAndView 的区别使用
查看>>
寒假编程总结一
查看>>