Skip to content

galleniz/IniParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INI Lib

A library to parse INI files.

Install

  • haxelib git ini https://github.com/MrNiz/IniParser

Example Usage

  • first obtain a INI with data
["keys"]
up="UP"
down="DOWN"
["volume"]
master=100
  • Second parse it in haxe.
/**
["keys"]
up="UP"
down="DOWN"
["volume"]
master=100
*/
var myIni = sys.io.File.getContent("config.ini").trim();
/*
{keys=> {up= "UP", down="DOWN"},volume=>{master=>100}}
*/
var map:ini.Ini.INI = ini.Ini.parse(myIni);
  • For last step use in you Game!
// Using Flixel example.

import flixel.FlxSprite;
import flixel.FlxState;

class MyState extends FlxState
{
    override function create():Void
    {
        super.create();
        var myIni = sys.io.File.getContent("character.ini").trim();

        var map:ini.Ini.INI = ini.Ini.parse(myIni);
        var damian = map.get("Damian")
        var sprite = new FlxSprite().loadSprite(damian.get("file"));
    }

}

About

A simple INI Parser for Haxe.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages