Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Krizzu
Prole
Posts: 20
Joined: Sun Apr 15, 2012 8:02 pm

Re: Advanced Tiled Loader

Post by Krizzu »

How to avoid that black spaces? To full windows with my tiles?
Attachments
1.png
1.png (13.31 KiB) Viewed 2821 times
MasterShizzle
Prole
Posts: 3
Joined: Mon Apr 16, 2012 10:58 pm

Re: Advanced Tiled Loader

Post by MasterShizzle »

All right, I'm having a devil of a time trying to get my maps to display correctly with this.

It worked fine for a while, but now it's displaying maps that are all kinds of messed up. I don't know if it was the update to 0.10.0 that did it, or what... Basically, I've got a simple single-layer map from Tiled that I want to display, but nothing is where it's supposed to be and the map actually seems to be wrapping and repeating itself in places. The bottom, top, and left sides never display, and the tiles that show in the middle are in a different order.

What am I missing here? I imagine there's something simple that I'm not doing or need to do, but it escapes me. I've been pecking at this on and off for a couple weeks now, and nothing seems to work. Check out the attached .love, and then open up the "map01.tmx" in Tiled and you'll see what I mean.
Attachments
WeirdMaps.love
My weirdness
(43.59 KiB) Downloaded 80 times
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

Krizzu wrote:How to avoid that black spaces? To full windows with my tiles?
It's hard to tell without a .love but it looks like the draw range isn't being set correctly. Try adding in this line before you draw the map:

Code: Select all

map:setDrawRange(-math.huge, -math.huge, math.huge, math.huge)
If that fixes it then it's a draw range issue.
MasterShizzle wrote:All right, I'm having a devil of a time trying to get my maps to display correctly with this.

It worked fine for a while, but now it's displaying maps that are all kinds of messed up. I don't know if it was the update to 0.10.0 that did it, or what... Basically, I've got a simple single-layer map from Tiled that I want to display, but nothing is where it's supposed to be and the map actually seems to be wrapping and repeating itself in places. The bottom, top, and left sides never display, and the tiles that show in the middle are in a different order.

What am I missing here? I imagine there's something simple that I'm not doing or need to do, but it escapes me. I've been pecking at this on and off for a couple weeks now, and nothing seems to work. Check out the attached .love, and then open up the "map01.tmx" in Tiled and you'll see what I mean.
That's really strange. I'll take a look at it and let you know if I figure something out.

-- EDIT --

Okay I've fixed the issue and uploaded a new version of ATL. Let me know if you have any more problems.
MasterShizzle
Prole
Posts: 3
Joined: Mon Apr 16, 2012 10:58 pm

Re: Advanced Tiled Loader

Post by MasterShizzle »

Kadoba wrote:Okay I've fixed the issue and uploaded a new version of ATL. Let me know if you have any more problems.
Works like a charm now, thanks for the quick fix. And my other issue with the draw range (same as Krizzu's) is now solved.

Two trouble-shoots in one post! You are a wizard, sir.
User avatar
Krizzu
Prole
Posts: 20
Joined: Sun Apr 15, 2012 8:02 pm

Re: Advanced Tiled Loader

Post by Krizzu »

And what about case, when I got map 1280x960 (maden in tiled) and my window is only 800x600?

When I put it and set draw range (0,0,1280,960) all map is squeezed in that 800x600.

How to avoid it?
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

I'm not sure if I understand. Are you saying that the map is resized in the game? ATL doesn't do any resizing. The draw range is just the portion of the map to draw. Can you upload a .love?
User avatar
Krizzu
Prole
Posts: 20
Joined: Sun Apr 15, 2012 8:02 pm

Re: Advanced Tiled Loader

Post by Krizzu »

Sure,
Attachments
Game.love
(54.1 KiB) Downloaded 95 times
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

It looks like you're having the same problem Shizzle was having. The latest version fixes that.
GameFixed.love
(53.8 KiB) Downloaded 101 times
User avatar
Krizzu
Prole
Posts: 20
Joined: Sun Apr 15, 2012 8:02 pm

Re: Advanced Tiled Loader

Post by Krizzu »

So I didn't had latest version of ATL?
Thanks anyway :)
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

Another small update. Relative paths from .tmx files to tileset images now work completely. Traveling backwards in directories (/../) does not work natively so I had to resort to some gsub sorcery. Now you should be able to require the library, load the maps, and store the tileset images anywhere you want.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest