Skip to content

zlgopen/awtk-widget-rive

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
idl
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

awtk-widget-rive

Rive 是一个超级强大的动画格式及配套工具。rive player 控件是基于 rive-cpp 实现的 Rive 播放器。

准备

  1. 获取 awtk 并编译
git clone https://github.com/zlgopen/awtk.git
cd awtk; scons; cd -
  1. 获取 awtk-widget-rive 并编译
git clone https://github.com/zlgopen/awtk-widget-rive
cd awtk-widget-rive
git clone https://github.com/rive-app/rive-cpp src/rive-cpp
scons

运行

    1. 生成示例代码的资源
python scripts/update_res.py all

也可以使用 Designer 打开项目,之后点击 “打包” 按钮进行生成; 如果资源发生修改,则需要重新生成资源。

如果 PIL 没有安装,执行上述脚本可能会出现如下错误:

Traceback (most recent call last):
...
ModuleNotFoundError: No module named 'PIL'

请用 pip 安装:

pip install Pillow
  1. 编译
  • 编译 PC 版本
scons
  • 编译 LINUX FB 版本
scons LINUX_FB=true

完整编译选项请参考 编译选项

  1. 运行
./bin/demo

文档

  • 在 XML 创建的方法
  <rive x="c" y="m" w="600" h="400" name="rive" url="heart.riv"/>

已知问题

  • 请使用 cairo 作为 vgcanvas 的 backend 获得完整功能演示,其它 backend 由于不支持 clip path 和多个 stop 的渐变色,可能存在潜在的问题。

修改 awtk/awtk_config.py,并重新编译:

VGCANVAS='CAIRO'

About

rive player for awtk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published