hi!
trying to get some seamless scrolling together in love using delta timing. anyone know how to 'floor' x/y values in lua?
thanks!
x
floor integers?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- hertzcastle
- Party member
- Posts: 100
- Joined: Sun Jan 04, 2009 4:51 pm
- Location: brighton, uk
Re: floor integers?
math.floor()
- hertzcastle
- Party member
- Posts: 100
- Joined: Sun Jan 04, 2009 4:51 pm
- Location: brighton, uk
Re: floor integers?
(slaps own forehead)...should have known it was something simple like that...
cheers mate!x
cheers mate!x
Re: floor integers?
For all your Lua needs, remember to check first:
- 1. the reference http://www.lua.org/manual/5.1/. There's all you need to know there, once you know a bit about the language.
- 2. the official book, http://www.lua.org/pil/ for more friendly and verbose explanations. Ideal to learn. It should also cover most of your needs, as it introduces some data structures, algorithms, etc, which help you getting familiar with the language.
Putting the cart before the horse rarely works.
"When in doubt, use brute force." Ken Thompson
- hertzcastle
- Party member
- Posts: 100
- Joined: Sun Jan 04, 2009 4:51 pm
- Location: brighton, uk
Re: floor integers?
yea sorry bout askin.
basically what im trying to do is get a parralax scrolling effect. this still doesnt work as theres gaps between every few images. any tips on this?
x
basically what im trying to do is get a parralax scrolling effect. this still doesnt work as theres gaps between every few images. any tips on this?
x
Re: floor integers?
another good lua reference: http://pgl.yoyo.org/luai/i/_
You could combat gaps by:
1) making your images overlap a little (so a bit of shift is ok)
2) placing images relative to each other.
eg: img1 at img1.x, img2 at img1.x+img1.width, img3 at img1.x+img1.width+img2.width, etc
3) use a package to handle the scrolling (eg http://love2d.org/wiki/index.php?title=CAMERA)
You could combat gaps by:
1) making your images overlap a little (so a bit of shift is ok)
2) placing images relative to each other.
eg: img1 at img1.x, img2 at img1.x+img1.width, img3 at img1.x+img1.width+img2.width, etc
3) use a package to handle the scrolling (eg http://love2d.org/wiki/index.php?title=CAMERA)
Re: floor integers?
Thanks for those, I was having a hard time finding a good learning source but the book is exactly what I was after.Tenoch wrote:
For all your Lua needs, remember to check first:
- 1. the reference http://www.lua.org/manual/5.1/. There's all you need to know there, once you know a bit about the language.
I strongly recommend bookmarking and studying those.
- 2. the official book, http://www.lua.org/pil/ for more friendly and verbose explanations. Ideal to learn. It should also cover most of your needs, as it introduces some data structures, algorithms, etc, which help you getting familiar with the language.
Putting the cart before the horse rarely works.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests