platformize-oasis
v0.8.3
Published
platformize oasis to many platform wechat/taobao miniprogram/game
Downloads
11
Readme
platformize-oasis
[email protected]
|[email protected]
专门适配
更加全面的适配可参考官方的适配库 oasis-engine/miniprogram-adapter 也欢迎 PR 集成到本仓库
使用
# 0.8.3
pnpm i -S [email protected] [email protected]
# 0.6.3
pnpm i -S [email protected] [email protected]
rollup.config.js
注入特定配置
import { mergeRollupOptions } from 'platformize-oasis/dist-plugin';
export default mergeRollupOptions(
{
input: ['./miniprogram/pages/index/index.ts'],
output: {
format: 'cjs',
dir: 'miniprogram/',
entryFileNames: 'pages/[name]/[name].js',
},
},
{ minify: process.env.BUILD === 'production' },
);
自行组装版本见这里
import { PlatformManager, WechatPlatform } from 'platformize-oasis';
const width = canvasClientWidth;
const height = canvasClientHeight;
const wechatPlatform = new WechatPlatform(canvas, width, height);
PlatformManager.set(wechatPlatform);
window.innerWidth
window.innerHeight
window.devicePixelRatio
requestAnimationFrame();
cancelAnimationFrame();
const xhr = new XMLHttpRequest();
...等等
// 使用完毕后销毁资源
wechatPlatform.dispose();
详细例子
BUG
2022/8/6 发现微信小程序gl.texSubImage2D api有问题...目前只修复了GLTexture2D.setImageSource, setPixelBuffer依然有问题...
讨论
可通过群里 DeepKolos 联系我
赞助
如果项目对您有帮助或者有适配需求,欢迎打赏
感谢各位支持~~