How to load map correctly using STI (Simple Tiled Implementation)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
RealCrayfish
Prole
Posts: 3
Joined: Thu Sep 01, 2022 7:48 pm
Location: Somewhere in the Bri'ish lands
Contact:

How to load map correctly using STI (Simple Tiled Implementation)

Post by RealCrayfish »

I've been trying to load my map using STI however when I run Map:draw() the map is missing 2 columns on the right and 1 row on the bottom (see image). How would I go around fixing this?

Info (If somehow its useful):
Tile Size: 64x64px
Width: 32 tiles
Height: 18 tiles

Code:

Code: Select all

sti = require("libs.sti")
map = sti("assets/maps/dev.lua")

...

function love.draw()
	map:draw()
end
Edit: .love attatched just in case it somehow proves useful
Attachments
WaifuTD.love
(50.21 KiB) Downloaded 126 times
Untitled.png
Untitled.png (45.23 KiB) Viewed 3223 times
User avatar
pgimeno
Party member
Posts: 3672
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to load map correctly using STI (Simple Tiled Implementation)

Post by pgimeno »

If no one answers, maybe try in the STI thread - viewtopic.php?f=5&t=76983
Ross
Party member
Posts: 100
Joined: Tue Mar 13, 2018 12:12 pm
Contact:

Re: How to load map correctly using STI (Simple Tiled Implementation)

Post by Ross »

I'm not sure of the exact solution, but it seems to be some interference between 'push' and STI. It's being cropped because STI thinks the viewport is smaller than it actually is. Try using map:resize(w, h) (with your game resolution) after loading the map in your game state.
RealCrayfish
Prole
Posts: 3
Joined: Thu Sep 01, 2022 7:48 pm
Location: Somewhere in the Bri'ish lands
Contact:

Re: How to load map correctly using STI (Simple Tiled Implementation)

Post by RealCrayfish »

Ross wrote: Fri Sep 02, 2022 2:55 pm Try using map:resize(w, h) (with your game resolution) after loading the map in your game state.
Thanks a lot! This works perfectly
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests