DXOpal anmxml2json


Source code

main.rb

#!ruby -Ku
# -*- mode: ruby; coding: utf-8 -*-
# Last updated: <2018/03/05 20:51:15 +0900>
#
# Play animation with DXRuby
require 'pp'
PLAYER_IMAGE_FILE = "data/scifistk01_pose.png"
JSON_FILE = "data/animedata.json"
if RUBY_ENGINE == "opal"
# In case of DXOpal
require 'dxopal'
include DXOpal
Image.register(:player, PLAYER_IMAGE_FILE)
else
# In case of DXRuby
require 'dxruby'
end
class AnimeCtl
# @!attribute patterns
# @return [Array] pattern name list
attr_accessor :patterns
# @!attribute hflip
# @return [true, false] H flip
attr_accessor :hflip
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Resources

Tools

convert animation XML to JSON. XML is exported from EDGE2.

> ruby anmxml2json.rb --help

Usage: anmxml2json [options]
    -i, --xml=FILE       Input XML file
    -o, --output=FILE    Output JSON file
    -w, --width=VAL      Tile width (dot)
    -h, --height=VAL     Tile height (dot)
    -x, --xcount=VAL     Tile x number

Example

ruby anmxml2json.rb -i hoge.xml -w 96 -h 96 -x 10 -o hoge.json

License

CC0 / Public Domain