GithubHelp home page GithubHelp logo

painttheworld's Introduction

Paint the World

脚本使用方法

脚本分为两部分:对象,动作

使用的时间轴单位为秒,绘画或暂停时计时器停止。

{
	"obj":[],
	"actions":[]
}

对象(obj)格式:

{
	"name":"background",
	"tex":"bg.jpg",
	"pos":[0,0,0],
	"scale":1.5
},
{
	"name": "sun",
	"tex": "sun.png",
	"scale": 0.3,
	"pos": [100, 100, 20]
}

其中,name为对象名称;tex为图片文件名(图片统一存储在res/文件夹下)

pos为对象位置,[x,y,z]

其中,以左上角为原点

*--------> x
|
|
|
|
V
Y

可选参数:

scale: 图像放缩比例

hide: [bool]对象初始时是否隐藏

动作(actions)格式:

  • move 直线移动

obj为被操作的对象,start为开始动作的秒数,offset为位移

v为速度[可选参数], 约为每秒移动的像素点数

{
	"type": "move",
	"obj": "sun",
	"start": 2,
	"offset": [0, -100]
}
  • bezier 贝塞尔曲线移动

end为终止动作的秒数[可选]

seq为贝塞尔曲线点坐标

v为移动速度

{
	"type": "bezier",
	"obj": "xiaoming",
	"start": 3,
	"end": 20,
	"seq": [[300, 450], [450, 100],[650, 450]],
	"v": 0.001
}
  • change_tex 改变对象贴图

tex为目标贴图

{
	"type": "change_tex",
	"obj": "xiaoming",
	"tex": "xiaoming.png",
	"start": 3.5
}
  • rotate 旋转

逆时针为正方向

可选参数

end: 终止旋转的时间

tovalue: 目标角度(角度制, 正图像的角度为0度)

{
	"type": "rotate",
	"obj": "sun",
	"v": 2,
	"start": 1
}
  • scale 放缩

tovalue: 目标比例

{
	"type": "scale",
	"obj": "sun",
	"v": 0.01,
	"start": 1,
	"tovalue": 0.5
}
  • hide, show 隐藏,显示
{
	"type": "show",
	"obj": "sun",
	"start": 4
}
  • move_screen 移动屏幕
{   
	"type": "move_screen",
	"offset": [200, 0],
	"start": 3,
	"v": 1
}
  • pause 暂停

  • draw 绘画

绘画窗口位置及大小:window [x,y,w,h] 绘画的正确类型: kind

{
	"type": "draw",
	"window": [10,10,200, 200],
	"kind": "bird"
}
  • 显示字幕

可选参数: end 字幕结束时间

{
    "type": "caption",
    "caption": "Hello, XiaoMing!",
    "start":2
}

painttheworld's People

Contributors

wkcn avatar guody5 avatar

Watchers

James Cloos avatar  avatar  avatar Yupan Huang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.