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

surfaces_yaml

v1.0.0

Published

Yet another surfaces.txt - surfaces.yaml

Downloads

11

Readme

surfaces_yaml

Yet another surfaces.txt - surfaces.yaml

Installation

this requires js-yaml

npm install -g surfaces_yaml

Usage

surfaces_yaml surfaces.yaml surfaces.txt

or use this on your program ...

var fs = require('fs');
var SurfacesYaml = require('surfaces_yaml');
var yaml_str = fs.readFileSync('surfaces.yaml', 'utf8');
var txt = SurfacesYaml.yaml_to_txt(yaml_str);
fs.writeFileSync('surfaces.txt', txt, 'utf8');

or use this on the browsers ...

<script src="js-yaml.min.js"></script>
<script src="surfaces_yaml.js"></script>
...
var txt = SurfacesYaml.yaml_to_txt(yaml_str);

surfaces_yaml command currently supports only utf-8 output (because shift_jis support requires iconv, but sometimes problems will occur when installing it to Windows under some environments).

surfaces.yaml

surfaces.yaml is a structured replacement of the "surfaces.txt", component of 伺か(Ukagaka) ghost.

surfaces.yaml is YAML but surfaces_yaml allows tabs.

Synopsis

examples/surfaces.yaml

this will be converted to examples/surfaces.txt

charset : UTF-8

descript :
    # SERIKO/2.0
    version : 1
    maxwidth : 300
    collision-sort : ascend
    animation-sort : ascend

surfaces :
    # 継承のためidで管理
    素 :
        # isの番号がsurface*に記述される
        # isがある場合のみエントリは記述される(is無しは継承元としてのみ機能)
        is : 0
        # trueのキャラクターにaliasを作る
        characters :
            # sakura.surface.aliasに追加
            sakura : true
        # point.*
        points :
            centerx : 0
            centery : 0
            kinoko :
                centerx : 0
                centery : 0
            basepos :
                x : 0
                y : 0
        # balloon.*
        balloons :
            sakura :
                # sakura.balloon.*
                offsetx : 0
                offsety : 0
            # balloon.*
            offsetx : 0
            offsety : 0
        # element*
        elements :
            # 継承のためidで管理
            ベース :
                # isの番号がelement*に記述される
                # isがある場合のみエントリは記述される(is無しは継承元としてのみ機能)
                is : 0
                # element*,type,file,x,y
                type : overlay
                file : surface0.png
                x : 0
                y : 0
            表情 :
                is : 1
                type : overlayfast
                file : surface1000.png
                x : 30
                y : 50
        # collision*
        regions :
            # 継承のためidで管理
            胸 :
                # isの番号がcollision*に記述される
                # isがある場合のみエントリは記述される(is無しは継承元としてのみ機能)
                is : 0
                # 領域のID
                name : bust
                # type=rectならcollision、それ以外ならcollisionexとして出力
                type : rect
                # collision*,left,top,right,bottom,ID
                left : 20
                top : 110
                right : 100
                bottom : 130
            顔 :
                is : 1
                name : face
                type : polygon
                # collisionex*,ID,polygon,coordinates[0].x,coordinates[0].y,...
                coordinates :
                    - {x : 30, y : 50}
                    - {x : 80, y : 55}
                    - {x : 80, y : 85}
                    - {x : 30, y : 85}
            肩 :
                is : 2
                name : kata
                type : ellipse
                # collisionex*,ID,ellipse,top,right,bottom
                left : 80
                top : 100
                right : 90
                bottom : 110
        # animation*
        animations :
            # 継承のためidで管理
            目パチ :
                # isの番号がanimation*に記述される
                # isがある場合のみエントリは記述される(is無しは継承元としてのみ機能)
                is : 0
                # animation*.interval
                interval : random,10
                # animation*.option
                option : exclusive
                # animation*.pattern*
                patterns :
                    # 配列インデックスがpattern*に記述される
                    -
                        # animation*,pattern*,type,surface,wait,x,y
                        # うち場合によって後半必要でないものは記述しなくてよい
                        type : overlay
                        # surface番号(-1,-2等含む)かsurfacesでの定義id
                        surface : 1001
                        wait : 125
                        x : 40
                        y : 55
                    - {type : overlay, surface : 1002, wait : 125, x : 40, y : 55}
                    - {type : overlay, surface : -1}
                # animation*.collision*
                regions :
                    # regionsの定義と同一
                    まぶた :
                        is : 0
                        name : mabuta
                        type : rect
                        left : 40
                        top : 55
                        right : 75
                        bottom : 70
    エロ面 :
        is : 1
        # 継承元id
        base : 素
        elements :
            表情 :
                # 継承元から変更する属性のみを記述する
                file : surface1010.png
        animations :
            サンプル1 :
                is : 1
                interval : never
                patterns :
                    # start, stop, insertはanimation_idのみを指定
                    - {type : start, animation_id : 目パチ}
            サンプル2 :
                is : 2
                interval : never
                patterns :
                    # alternativestart, alternativestopはanimation_idsのみを指定
                    - {type : alternativestart, animation_ids : [目パチ,サンプル1]}
    驚き :
        is : 2
        base : 素
        elements :
            表情 :
                file : surface1020.png
        regions :
            # deleteキーワードで継承元のエントリを無効にする
            胸 : delete
    笑顔1 :
        is : 5
        base : 素
        elements :
            表情 :
                file : surface1050.png
    笑顔2 :
        is : 50
        # 多重継承可能 後に書いたほうの属性が優先される
        base : [素, 驚き]
        elements :
            表情 :
                file : surface1500.png

aliases :
    #sakura.surface.alias
    sakura :
        # 笑顔,[...]
        笑顔 :
            # surface番号かsurfacesでの定義id
            - 笑顔1
            - 笑顔2

regions :
    # *.cursorと*.tooltipsの定義
    sakura :
        # 領域ID
        bust :
            # sakura.tooltips
            # bust,むねだよ
            tooltip : むねだよ
            # sakura.cursor
            cursor :
                # mouseup*,bust,system:hand
                mouseup : system:hand
                mousedown : system:grip