/nxpy

A simple Python library to parse NX files

Primary LanguagePythonMIT LicenseMIT

Python Nx Parser

Loading Nx files

NxFile

file = NxFile('your-path-to-nx/map.nx')

NxFileSet

fileSet = NxFileSet('your-path-to-nx/map.nx', 'your-path-to-nx/sound.nx')
fileSet.load('your-path-to-nx/ui.nx')

Retrieving values from data types [long, double, string, point(x, y)]

NxNode

node = file.resolve('Map/Map0/000010000.img/info/bgm')
data = node.value

Retrieving buffers from images and sounds

NxImage

node = file.resolve('Tile/grassySoil.img/bsc/0')
data = node.get_image()

NxSound

node = file.resolve('Bgm34.img/MapleLeaf')
data = node.get_sound()

Additional Resources