AnimGroup:动漫游戏引擎的动画组库

  • d2_810847
    了解作者
  • 59.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-28 05:49
    上传日期
动画组 小型游戏引擎的动画库取决于可以制作动画组,包括顺序和并行动画组,并在指定的秒数内插入暂停并在动画组内调用函数,或在特定时间循环动画。 用法 只需将放到您的Löve项目中,然后要求它即可。 基本补间动画 local ag = require ' anim_group ' local logo = love. graphics . newImage ( ' logo.png ' ) local logo_pos = { x = (love. graphics . getWidth () - logo: getWidth ()) / 2 , y = 0 } -- create simple tween animation local anim = ag. tween { subject = logo_pos, target = { y = (love. graphics .
AnimGroup-master.zip
  • AnimGroup-master
  • tween.lua
    12.3KB
  • main.lua
    2.5KB
  • AvenirNextLTPro-Regular.otf
    65.2KB
  • LICENSE
    1.1KB
  • README.md
    2.7KB
  • logo.png
    12.7KB
  • conf.lua
    91B
  • anim_group.lua
    7.4KB
内容介绍
# AnimGroup An animation library for löve game engine, depends on [tween.lua](https://github.com/kikito/tween.lua) You can make animation groups, including sequential and parallel animation groups, and insert pause for specified seconds and function call inside animation group, or loop animation for specific times. # Usage Just drop [anim_group.lua](https://github.com/Moligaloo/AnimGroup/blob/master/anim_group.lua) to your Löve project and then require it. # Basic tween animation ```lua local ag = require 'anim_group' local logo = love.graphics.newImage('logo.png') local logo_pos = { x = (love.graphics.getWidth()-logo:getWidth())/2, y = 0 } -- create simple tween animation local anim = ag.tween{ subject = logo_pos, target = { y = (love.graphics.getHeight()-logo:getHeight())/2 }, duration = 1, easing = 'outBounce' } -- don't forget update in love.update function love.update(dt) anim:update(dt) end -- draw function love.draw() love.graphics.draw(logo, logo_pos.x, logo_pos.y) end ``` # Tween parameters `duration`, `subject` and `easing` has same meaning in tween.lua's `tween.new` function, `to` is equivalent to `tween.new`'s `target`. However, you have to pass these parameters in a table. Additionally, this library provide some extras: * `duration` is optional (default to 1). * Optional parameter `from`: if this parameter is given, `subject` will set fields from `from` before calculating interpolated values. It is useful when run repeated animation. * `to` can be replaced to `delta`, this is a relative offset to subject, below code shows an animation that down to 100 pixels: ```lua local anim = ag.tween { subject = values, delta = {y = 100} } ``` NOTE: Tween animation's internal interpolated values are calculated when run instead of being created. # Sequential animation group The two animations will group into one and run sequentially ```lua local anim = ag.sequence{ ag.tween{...}, ag.tween{...} } -- more fancy way, use '+' operator local anim = ag.tween{...} + ag.tween{...} ``` # Parallel animation group The two animations will group into one and run parallel ```lua local anim = ag.parallel{ ag.tween{...}, ag.tween{...} } -- more fancy way, use '/' operator local anim = ag.tween{...} / ag.tween{...} ``` # Insert a pause for a specified duration ```lua local anim = ag.tween{...} + ag.delay(2) + -- delay 2 seconds ag.tween{...} ``` # Insert function call ```lua local anim = ag.tween{...} + -- this will call after first animation is done ag.func(function() ... end) + ag.tween{...} ``` # Repeat animation ```lua local anim = ag.tween{...} * 2 ``` # Demo Download this project and run by love executable and you will run the demo.
评论
    相关推荐
    • 游戏引擎架构
      这个是带完整目录书签的文字版本,文本内容可以复制的哦
    • 游戏引擎
      OpenGL前向渲染器。 经过Zig 0.6.0测试 ...ModelFiles:从自定义文件格式加载模型和动画 RTRenderEngine:场景的实时渲染。 取决于:WindowGraphicsInput,数学,ModelFiles,Assets,Files.zig,R
    • rokon游戏引擎API
      rokon游戏引擎 类与方法介绍 游戏引擎开发步骤
    • ngc游戏引擎 2D
      ngc游戏引擎,支持中文,button,edit,list,tab... TILE地图,内含动画编辑器,地图编辑器,纹理打包
    • 游戏引擎剖析
      游戏引擎剖析 还不错 收录网站的
    • 3D 游戏 引擎
      一个开源3D游戏引擎 画面渲染很牛逼动画管理还不是很完善你自己可以改造下 里面有好多技术范例
    • HGE引擎棋牌游戏简单例子
      用HGE游戏引擎制作的棋牌游戏发牌动画,包括点击牌提起,拖动选牌,自定义的按钮等。想制作游戏的可以参考此例。
    • 游戏引擎架构文档
      本文件包含2个文档 主要描述了游戏引擎的架构以及引擎的快速入门
    • HGE游戏引擎动画效果展示
      使用HGE引擎写的一个田园风景动画展示例子,需要的可以下来看看。
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档