Im trying out this Simple Tile Implementaion. I found tutorials. I followed this tutorial and wrote it the exact way, but everytime I run it my sprite wont appear but in the tutorial it appears. Im new to this. Help?
(I am trying to achieve the third pic)
Here is the tutorial link: http://lua.space/gamedev/using-tiled-maps-in-love
Need help with STI
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Need help with STI
Have you checked Karai's github? There are working examples there. There are even some other .love files in his thread about STI in the libraries section. Can't check your code until tomorrow when I'll have a pc.
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Re: Need help with STI
Just solved it. My mistake didnt see the problem from the beginning. My only problem now is how do I draw a quad?
Re: Need help with STI
How to draw a quad in general?
In this case I repeat the image two times
In this case I repeat the image two times
Code: Select all
function love.load()
self.x = 0
self.img = lg.newImage("pic.png")
self.img:setWrap("repeat", "repeat")
self.width = self.img:getWidth()
self.height = self.img:getHeight()
self.quad = lg.newQuad(0, 0, 2, self.height, self.img:getDimensions())
self.y = 0
self.sx = 1
self.sy = 1
end
function love.draw()
lg.draw(self.img, self.quad, self.x, self.y, 0, self.sx, self.sy)
end
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Re: Need help with STI
Sorry for not being that specific. I know how to draw a quad in general, But this library only supports a drawable and I cant seem to add a quad. Do I use spritebatch for this?
Re: Need help with STI
Sorry, I don't know how to help you.KyleFlores1014 wrote: ↑Fri Dec 01, 2017 10:38 am Sorry for not being that specific. I know how to draw a quad in general, But this library only supports a drawable and I cant seem to add a quad. Do I use spritebatch for this?
You could try in the STI thread maybe?
https://love2d.org/forums/viewtopic.php ... &start=720
-
- Citizen
- Posts: 73
- Joined: Thu May 25, 2017 1:43 pm
Re: Need help with STI
Ok, thanks for the help anyways
Who is online
Users browsing this forum: No registered users and 82 guests