/ld27

To get this branch, use:
bzr branch http://9ix.org/bzr/ld27

« back to all changes in this revision

Viewing changes to zoetrope/sprites/fill.lua

  • Committer: Josh C
  • Date: 2013-08-25 00:16:36 UTC
  • Revision ID: josh@9ix.org-20130825001636-xoivc9byo1mdx0fu
1 goal in each maze

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
                local scaleY = self.scale * self.distort.y
38
38
 
39
39
                if scaleX ~= 1 or scaleY ~= 1 or self.rotation ~= 0 then
40
 
                        local origX = self.origin.x or (self.width / 2)
41
 
                        local origY = self.origin.y or (self.height / 2)
42
 
 
43
40
                        love.graphics.push()
44
 
                        love.graphics.translate(x + origX, y + origY)
 
41
                        love.graphics.translate(x + self.width / 2, y + self.height / 2)
45
42
                        love.graphics.scale(scaleX, scaleY)
46
43
                        love.graphics.rotate(self.rotation)
47
 
                        love.graphics.translate(- (x + origX), - (y + origY))
 
44
                        love.graphics.translate(- (x + self.width / 2), - (y + self.height / 2))
48
45
                end
49
46
                
50
47
                -- draw fill and border
81
78
        end,
82
79
 
83
80
        __tostring = function (self)
84
 
                local result = 'Fill (x: ' .. tostring(self.x) .. ', y: ' .. tostring(self.y) ..
85
 
                                           ', w: ' .. tostring(self.width) .. ', h: ' .. tostring(self.height) .. ', '
 
81
                local result = 'Fill (x: ' .. self.x .. ', y: ' .. self.y ..
 
82
                                           ', w: ' .. self.width .. ', h: ' .. self.height .. ', '
86
83
 
87
84
                if self.fill then
88
85
                        result = result .. 'fill {' .. table.concat(self.fill, ', ') .. '}, '