GithubHelp home page GithubHelp logo

code examples about tiledcs HOT 13 CLOSED

thebonejarmer avatar thebonejarmer commented on June 30, 2024
code examples

from tiledcs.

Comments (13)

 avatar commented on June 30, 2024 1

My question (for the last time): you write a library and give NO docs or examples.
I kindly ask you to write some docs (what methods are there, how to use them etc) or a FULL code example that shows how to use your library on an example map.

So yes, it's how to use the data in a C# program by using your library. (how to initialize things, how to loop through layers, etc etc. Everything that your library can do (the basic things))

from tiledcs.

TheBoneJarmer avatar TheBoneJarmer commented on June 30, 2024

Hey

When you talk about layers, do you mean tile layers or object layers? Tiled treats them both as layers but they are fundamentally very different. So I am gonna assume you mean tile layers. You can access all layers using the TiledMap.Layers property. This is an array of type TiledLayer. And the TiledLayer class contains a field called type. So you can use Linq to fetch all layers whose type equals that of a tile layer like this:

var map = new TiledMap("path-to-your-map.tmx");
var tileLayers = map.Layers.Where(x => x.type == "tilelayer");

With kind regards,
TheBoneJarmer

from tiledcs.

 avatar commented on June 30, 2024

Hello

As a beginner I cna't understand this library without any docs or complete examples.

Can you make a Tiled map, read it and show all information by using your library (both type of layers)?
Then put the code in the "examples" folder?

You say MonoGame has no docs, but your library is the same considering docs or examples :-)

from tiledcs.

TheBoneJarmer avatar TheBoneJarmer commented on June 30, 2024

I gave you an example of how you can fetch all tilelayers. So to fetch all object layers just do the same but with objectgroup as type value. Then loop through the result and use either the Layer.data field in case of tile layers or the objects field in case of object layers.

Really it is not that difficult and you can easily figure out the rest if you toy around a bit. I have over 50 users who did it and so can you. So don't be lazy.

I do think your idea of an examples folder is good though, don't take me wrong. But you should wonder if it will help you. You will only get a simplified version of how to load a map but that won't apply to your case since you use MonoGame. How to use the imported data to render a map is entirely up to you to figure out. So in the end you will still be stuck with questions since even my one-liner above would be a sufficient example to load a map.

What you want to know is how to use the data you imported and for that I cannot show examples for as that is dependent on your game engine. The only advice I can give there is to let your IDE guide you. TiledCS is just a raw parser in the end.

from tiledcs.

 avatar commented on June 30, 2024

No, you don't understand my question...

I ask nothing about monogame or any other library. I specificly ask about TiledCS and how to read all possible things from a Tiled map.

I ask a code example of TiledCS ONLY that reads an example map you provide which has everything inside TiledCS can read (the 2 types of layers, etc etc).
Even with your explanation I don't find how to do it. I'm a complete beginner using your library.

So if you add the full code example once, all users (including me) will know immediately how it works.
I can keep asking questions here, because that's probalby going to happen without such a code example.

PS: I never used "Where". Is there a way to just have a foreach loop or so?

thanks in advance!

from tiledcs.

 avatar commented on June 30, 2024

What about my question about the Tile type? How to do this?

So you can see, a full code example with an example map is the best for me.
There is a BIG difference between your knowledge as a library developer and mine, as a library user...

from tiledcs.

TheBoneJarmer avatar TheBoneJarmer commented on June 30, 2024

Ah ok, yea I assumed you wanted to know how to get stuff done in MonoGame since your nickame as well as your previous issues. I think I understand what you are asking. But I do not think an example will do either way. You need something visual that you can link to your code. Otherwise there is no point since an example will just demonstrate a made-up case in which some could use TiledCS. But you like to know how to access layers, use its data and how the data is represented. With other words, the functional part of TiledCS. I assumed you meant the practical.

Truth is, most users simply open up their tmx file and use that as a guide. Because if something in the tmx file is located in the node Map/Layer/Data it is also located in TiledCS in TiledMap.Layers.Data. Its more of a comparison than anything else. What you need is a full-blown documentation that uses screenshots and code examples. I cannot promise such a thing will be done short-term as it will take some time. But your request is valid for that matter. And you are right, for me it is all straightforward of course. You are just like the first one to ask this and well, as you can see nobody else asked functional questions before and they do figured it out so you cannot blame me for thinking you should be able too.

from tiledcs.

 avatar commented on June 30, 2024

As a beginner to Tiled, its file format and structure and your TiledCS, I can't figure it out myself.
But a full code example with a map you made to demonstrate the data TiledCS can read, will still help me.
Why you don't want to give code examples is a mystery for me (I asked it 2 times now).
(screenshots etc would be not required at first, I'm happy with a code example that shows a complete example map you made being read)

from tiledcs.

TheBoneJarmer avatar TheBoneJarmer commented on June 30, 2024

Why you don't want to give code examples is a mystery for me (I asked it 2 times now).

Okay look, it is not about not willing. It is about me trying to figure the heck out what it is you want to accomplish. And on top of that it sounds like you are mixing some stuff up, making your whole request annoyingly confusing. I am only trying to help you so please put some effort into giving me the details I need instead of being this impatient. I lose time with this discussion too and I am not even getting paid for it. And in the end you are the one stuck with a problem, not me.

screenshots etc would be not required at first, I'm happy with a code example that shows a complete example map you made being read

And this is where I think you are mixing stuff up. The map has already been read. All the map data is right in the instance of the TiledMap class. So it is not about reading here but about how to use that data. Is that correct?

from tiledcs.

 avatar commented on June 30, 2024

I give an example because I don't know how else to explain it to you.

Here is the monogame-aseprite library: https://github.com/manbeardgames/monogame-aseprite

Here is a full code example how to use it (each method has comments what's it doing and also variables have comments):

https://github.com/manbeardgames/monogame-aseprite-demo/blob/stable/monogame-3.8-demo/MonoGame.Aseprite.Demo/Game1.cs

If you could make such a code example with comments that read an example map you made and that demonstrates the features of your library and how to use it, that would be fantastic.

from tiledcs.

TheBoneJarmer avatar TheBoneJarmer commented on June 30, 2024

Ok, now that is exactly what I needed to hear. And thanks for the examples, that did cleared up a thing or 2. Here is what I am gonna do:

  • Generate a code documentation (practical)
  • Use the GitHub wiki or something similar for an extended documentation (functional)
  • Provide an example project where I will be using a game framework to show results although it wont be MonoGame btw

I think that would give you all the info you need. But it is gonna take some time. And as a full-time software engineer with a family, I do not got that many. So like I said, it wont be for the short term. For the time being, although maybe not as practical, you could let your IDE guide you or take and perhaps have a look at other people's work. There are many who use TiledCS and most of them managed to use it so it should give you some insight.

from tiledcs.

 avatar commented on June 30, 2024

Great!
Please use any feature you have in TiledCS in the example project (just 1 usage of each feature somewhere). You then can add things when more features are implemented (or slightly changed, some method has changed or parameters, ...)

from tiledcs.

 avatar commented on June 30, 2024

PUT YOUR EXAMPLES IN YOUR UGLY ASS
NOBODY USES YOUR LIBRARY ANYWAY
EVERYBODY USES TILEDSHARP

from tiledcs.

Related Issues (20)

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.