All right, I understand now. You need a ladder segment image, not a ladder image, and if your ladder segment is an eighth of a tile, you would only move up by an eighth of a tile and draw it there. If you want it to be a sixteenth or a tenth, you can do that instead of an eighth. Maybe someone else could explain this better; without your code I can't explain it very well. Basically, you tile your image up by laddersegment:getHeight() / tilesize instead of the tile size.
EDIT: All right, I'm gonna try to create an example using your code.
Code: Select all
a.graphics.draw(Pool.Get("Ladder"), v.Position.x, v.Position.y, 0, 1, 1, v.Size.x / 2, v.Size.y / 2)
Now, I can only assume what the a and v are, but since you're drawing it there, I assume it's the player. Now, you'd want some gridlocked placement function like this:
Code: Select all
function toLadderPoint(x, y)
local incXSize = 50
local incYSize = 50 / 20 -- assuming your tiles are 50 pixels wide and your segments are 20 pixels tall
local x = math.floor( v.Position.x / incXSize ) * incXSize
local y = math.floor( v.Position.y / incYSize ) * incYSize
return x, y
end
All the math of that was made by someone on here named Plu, I just modified it so the placement sections would be the correct sizes.