Permalink
Browse files

centered sprites in their boundries

  • Loading branch information...
1 parent efb1265 commit 8c31a4b4203933e670223d0c561785d93c4b0708 @Textmode Textmode committed Aug 28, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 entity.lua
View
@@ -36,6 +36,7 @@ function _M.new(t)
e.dir_y = t.dir_y or 0
e.speed = t.speed or 0
e.facing = t.facing or 0
+ e.scale = t.scale or 1
-- Handles the texture, width, and height fields
_M.set_texture(e, t.texture or generic_icon)
@@ -94,7 +95,7 @@ function _M:draw()
-- draw the actual sprite
lg.setColor(255, 255, 255)
- lg.draw(self.texture, self.pos_x, self.pos_y, self.facing)
+ lg.draw(self.texture, self.pos_x, self.pos_y, self.facing, self.scale, self.scale, self.width/2, self.height/2)
lg.pop()
end

0 comments on commit 8c31a4b

Please sign in to comment.