Git Product home page Git Product logo

ldtk_rust's People

Contributors

aleokdev avatar coocoocacha avatar estivate avatar psichix avatar scambier avatar tatref avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ldtk_rust's Issues

Consider using #rtype syntax for reserved word fields

in 0.1.0 the field named "type" is renamed in serde to something else. For instance in the Layer struct "type" is renamed to "layer_type".

An alternative would be to preface the field name with "r#" so "type" becomes "r#type".

Not sure which would be best for consumers.

Not working with LDTK 1.5.x

unknown variant `ExportOldTableOfContentData`, expected one of `DiscardPreCsvIntGrid`, `ExportPreCsvIntGridFormat`, `IgnoreBackupSuggest`, `MultiWorlds`, `PrependIndexToLevelFileNames`, `UseMultilinesType`

Tileset offset is different in LDTK vs Rust

Left is bevy (using engine example almost verbatim) and right is LDTK. As you can see the offset is a bit off. Debugging now but wanted to pass it along if you had any ideas. Using git version of ldtk_rust (although I don't think there are many changes, just because I'm on 0.7.2 for LDTK).

image

This is the tileset I'm using, by the way.

magecity

Add parsing for EntityInstances

EntityInstances can be implemented for the most part, but LDtk let's you create arbitrary fields to assign various values to Entities which is going to be an extra step in a strongly typed language like Rust. Specifically:

{
  "fieldInstances":[
    {
      "__identifier":"text",
      "__value":"Can be arbitrary text...",
      "__type":"String",
      "defUid":88,
    },
    {
      "__identifier":"colors",
      "__value":["#FFD500", "#FFD501", "#FFD502"],
      "__type":"Array<Color>",
      "defUid":90,
    }
  ]
}

Not sure how to deal with this in Serde. I can tag it with the serde type "Value" and let the caller figure it out, or maybe I can set up an Enum to use the internally tagged __type field to pick the right option. The possible types are limiited.

LDtk Integrated Icons Cause Crashes

Description
When loading a file that contains the use of LDtk's integrated icons, an error occurs with serde_json: "invalid type: null, expected a string at line x column y". As far as I can tell, this relates to the relPath field being null where it references integrated icons.

Reproduction
Create a ldtk project, create at least one thing that uses LDtk's integrated icons for its' editor representation, and export. You should find a tileset definition with relPath set to null. (Example file attached)

Potential Solution
Use the new embedAtlas field to detect such cases and replace relPath with either a Option<String> or an enum between String and LdtkIcons.

Use BufReader when loading files for a big speedup

Hey, first of all, thanks for making this crate, it works great and is well documented.

I wanted to quickly share that using a buffered reader on the Files speeds loading up by a big amount, for me on windows at least.

So, for example this:

use std::io::BufReader;
...
let file = BufReader::new(File::open(f).expect("level file not found"));

instead of this:

let file = File::open(f).expect("level file not found");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.