Comments (8)
What do you mean by this? I don't understand.
I was just explaining why I wouldn't use it. It's not important.
What's important is your last suggestion which is actually pretty cool! That I would definitely use!
from rs-tiled.
In the bevy_ecs_tilemap crate, somebody introduced a BytesResourceReader
, see StarArawn/bevy_ecs_tilemap#425. Does that help or would you still suggest we should add back load_tmx_map_from
?
from rs-tiled.
Huh, I guess I should've gone to the main branch before posting this. That along with what's in #265 is a good enough solution to me. I still don't see why the helper method had to go, but at least there's a reasonable alternative. Thanks!
from rs-tiled.
I still don't see why the helper method had to go, but at least there's a reasonable alternative. Thanks!
load_..._from
was a hacky method to only load completely embedded maps from some source. That is still possible in 0.11, it's just a bit more manual work. Perhaps we could add it back as the BytesResourceReader solution.
from rs-tiled.
Personally, it wouldn't do much good unless it would support supplying another ResourceReader
for the remainder of files. I know I asked how I could use it with the FilesystemResourceReader
, but since I can easily use a more portable solution from the beginning, I prefer portability.
from rs-tiled.
Personally, it wouldn't do much good unless it would support supplying another ResourceReader for the remainder of files.
Yeah, that's something load_tmx_map_from
could not do and it may be useful to have.
I know I asked how I could use it with the FilesystemResourceReader, but since I can easily use a more portable solution from the beginning, I prefer portability.
What do you mean by this? I don't understand.
Now that I think about it, we could implement ResourceReader
for anything that implements for<'a> Fn(&'a Path) -> Result<R, E> where R: Read, E: Error + Send + Sync + 'static
, which would allow easily defining a ResourceReader inline in the Loader declaration, removing a lot of boilerplate and simplifying the process altogether, something like this:
let mut loader = Loader::with_cache_and_reader(
DefaultResourceCache,
|path| { if path == "my-map.tmx" { Ok(that_map) } else { Err(MapLoadingError) }
);
What do you think about this?
from rs-tiled.
Thanks :) I'll try to PR it whenever possible. I'm currently really busy with exams so it probably won't be done until ~2weeks from now.
from rs-tiled.
Related Issues (20)
- Make TileData of Tile in Tileset accessible HOT 3
- Improve Data/Wrapper docs
- Renaming the `0.11` branch to `next` and `master` to `current` HOT 2
- Yanking the 0.9.5 release HOT 1
- Polygon colliders load as Rect shapes HOT 5
- Support for Web Assembly HOT 15
- since tiled 1.9 object type is renamed into class HOT 3
- tiled::FiniteTileLayer::get_tile returns empty tiles HOT 7
- Optional GIDs feature HOT 1
- Default zstd feature is unhelpful for wasm builds HOT 2
- Add support for tileset offset
- Nicer way to iterate over layers of a given type HOT 2
- Expose map's staggeraxis and staggerindex options.
- Allow obtaining the path of tilemaps that have been loaded HOT 9
- Loading map with TSX tileset error "Missing attribute: tilecount" HOT 11
- Image docs are outdated
- get rotaion of tile HOT 3
- Support for Tiled Custom Types HOT 2
- Unsigned indecies for getting a tile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rs-tiled.