1 Star 3 Fork 0

shiina / Ark-Particle-Imitate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Ark-Particle-Imitate

前言

原生 js 模仿明日方舟官网粒子效果

但是性能很差,我也不太会优化,个人更推荐使用 WEBGL 进行这种效果制作

如果没人做的话我以后可能会抽时间出来做(先画饼吧)

本项目仅供学习和娱乐,未来可能不怎么更新,大家当乐子看就好

项目有 ts 声明文件和中文注释,可以配合 vscode 智能提示进行使用

使用方法

参考 js/index.js 下的文件

实例创建后的可调用方法:

const canvas = document.getElementById('akCanvas')
/** 初始化实例 */
let demo = new DameDaneParticle(canvas,{
  src: './image/test.png',
  w: 360
})

/** 修改图片 */
demo.ChangeImg('./image/island.png',{
  renderX: 300,
  w: 200,
  effectParticleMode: 'adsorption',
  Drag: 0.95
})

/** 粒子散开 / 聚合状态切换 */
demo.ParticlePolymerize()

const tip = () => { console.log('destory') }

/** 预销毁实例 */
demo.PreDestory(tip)
/** 销毁 */
demo = null
MIT License Copyright (c) 2022 QingXia-Ela Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

原生 js 模仿明日方舟官网粒子效果 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/shiinafan/Ark-Particle-Imitate.git
git@gitee.com:shiinafan/Ark-Particle-Imitate.git
shiinafan
Ark-Particle-Imitate
Ark-Particle-Imitate
main

搜索帮助

14c37bed 8189591 565d56ea 8189591