I'm not entirely sure what I'm doing wrong here, but maybe someone could help me figure it out.
find my main.lua and love.lua here: http://www.hastebin.com/liwuxupomo.lua
and the tileset i'm using here: https://love2d.org/imgmirrur/dDSdTF7.png
When I set up my grid in player.load() using 0 as the border, everything works fine. I can adjust player.animations.tilesetRow to pick any of the 5 guys in the tileset. The problem is that there is a 1 pixel border surrounding them. When I set border to 1, the frame is offset by 1 pixel for every row I've moved on x or y. Am I using the border parameter wrong?
Anim8 newGrid() border parameter
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Anim8 newGrid() border parameter
I don't think Anim8 works with love 0.9.1, try using [wiki]AnAL[/wiki] instead.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Anim8 newGrid() border parameter
That is incorrect. Anim8 works just fine in the latests LÖVE. Besides, AnAL can't handle borders around frames at all, so it's really inadecuate for this task.Ranguna259 wrote:I don't think Anim8 works with love 0.9.1
Yes.tehryanx wrote:I'm not entirely sure what I'm doing wrong here, but maybe someone could help me figure it out.
[...]
. The problem is that there is a 1 pixel border surrounding them. When I set border to 1, the frame is offset by 1 pixel for every row I've moved on x or y. Am I using the border parameter wrong?
The "border" property goes "on the outside" of the frames, not "on the inside". It seems that your frames are smaller than what you say they are (border is not "part of each frame", is "in addition to the frame dimensions"). Try making your frames 2 pixel smaller (width and height) and add a 1 px border around them. The planes demo uses the border quite a lot.
To clarify, given your image, I would use this grid:
Code: Select all
local g = anim8.newGrid(21, 21, 690, 690, 0, 0, 1)
BTW I can't see your code - the link to hastebin you wrote seems empty. I had to deduce what was happening by what you said. I recommend using uploading a .love file to the forum instead, you will get better answers.
When I write def I mean function.
Who is online
Users browsing this forum: Bing [Bot] and 24 guests