Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Dart Tiled library. Parse your TMX files into useful representations. Compatible with Flame.

NotificationsYou must be signed in to change notification settings

flame-engine/tiled.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubcicdDiscord

A Dart Tiled library.

Install from Dart Pub Repository

To include the package as a depencency in yourpubspec.yaml, run the following (or add it manually):

dart pub add tiled

Usage

Import the package like this:

    import'package:tiled/tiled.dart';

Load Tmx Files

Load a TMX file into a string by any means, and then pass the string to TileMapParser.parseXml():

finalString tmxBody=/* ... */;finalTiledMap mapTmx=TileMapParser.parseTmx(tmxBody);

If your tmx file includes a external tsx reference, you have to add a CustomParser

classCustomTsxProviderextendsTsxProvider {@overrideParsergetSource(String fileName) {final xml=File(fileName).readAsStringSync();final node=XmlDocument.parse(xml).rootElement;returnXmlParser(node);  }}

And use it in the parseTmx method

finalString tmxBody=/* ... */;finalTiledMap mapTmx=TileMapParser.parseTmx(tmxBody, tsx:CustomTsxProvider());

Load Json Files

Alternatively load a json file.

finalString jsonBody=/* ... */;finalTiledMap mapTmx=TileMapParser.parseJson(jsonBody);

Implementation

For further information and more usage examples, please take a look at the examples inflame_tiled.

About

A Dart Tiled library. Parse your TMX files into useful representations. Compatible with Flame.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp