npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oce.js

v0.4.2

Published

oce是一个简单易用的精灵(舞台元件)控制框架,基于2D引擎pixijs,可用于制作带有交互操作的简单动画场景。

Downloads

5

Readme

oce

oce是一个简单易用的精灵(舞台元件)控制框架,基于2D引擎pixijs,可用于制作带有交互操作的简单动画场景。

可用于基于H5画布的PPT制作,简单的游戏,互动视觉界面等。

用法

安装

npm

npm install ocean-stage

yarn

yarn add ocean-stage

引用

import {Game,Stage,Display,Resources} from 'oce.js';
// 创建应用
const game = new Game(document.body, {
    width: 2048, 
    height: 1536,
    backgroundColor: 0xFFFFFF
});
// 创建舞台
const stage = new Stage();
game.addStage(stage);
// 元件数据对象
const beanDatas;
const urls = beanDatas.map(n => n.src);
// 添加外部元件资源
Resources.loader('123', urls).then(res => {
    for (var key in beanDatas) {
        addBean(beanDatas[key]);
    }
})

数据格式

beanDatas数据格式

[
    {
        "src": "http://47.103.50.205:91/car.jpg",
        "id": 123,
        // 类型
        "type": "image",
        // 基本属性
        "property": {
            "x": 50,
            "y": 50
        },
        // eventData触发事件
        "events": eventData,
    }
]

eventData 元件控制元件的数据格式

// 元件触发的事件列队
[{
    //绑定的元件需要需要触发的事件名称
    "name": "click",
    // 触发后需要处理的动作内容
    "content": {
        // 执行动作的元件集合
        "beans": {
            // key名为元件id,只为目标对象
            "671": {
                // 元件id
                "target": "671",
                // 元件要执行的动作
                "type": "soundPlay",
                // 元件执行动作的参数
                "pams": true
            },
            // key名为元件id,值为数组(动作列队)
            "665": [{
                // 元件id
                "target": "665",
                // 元件要执行的动作
                "type": "show",
                // 元件执行的动作参数
                "pams": true
            }, {
                "target": "665",
                "type": "shake",
                "pams": true
            }],
            "673": {
                "target": "673",
                "type": "soundPlay",
                "pams": false
            }
        }
    }
}]