/zoeplat

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

« back to all changes in this revision

Viewing changes to zoetrope/sprites/tile.lua

  • Committer: Josh C
  • Date: 2013-04-21 19:50:25 UTC
  • Revision ID: josh@9ix.org-20130421195025-bucje0kl5schb07m
trackĀ versionĀ (base)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        -- image must be a nonsense value, not nil,
23
23
        -- for the tile to see that an image has been set if it
24
24
        -- was initially nil
25
 
        _set = { image = -1, imageOffset = { x = 0, y = 0 } },
 
25
        _set = { image = -1 },
26
26
 
27
27
        -- private property imageObj: actual Image instance used to draw
28
28
        -- this is normally set via the image property, but you may set it directly
31
31
        new = function (self, obj)
32
32
                obj = obj or {}
33
33
                self:extend(obj)
 
34
                obj._set.imageOffset = {}
34
35
                
35
36
                if obj.image then obj:updateQuad() end
36
37
                if obj.onNew then obj:onNew() end
60
61
                y = math.floor(y or self.y)
61
62
        
62
63
                if STRICT then
63
 
                        assert(type(x) == 'number', 'visible fill does not have a numeric x property')
64
 
                        assert(type(y) == 'number', 'visible fill does not have a numeric y property')
65
 
                        assert(type(self.width) == 'number', 'visible fill does not have a numeric width property')
66
 
                        assert(type(self.height) == 'number', 'visible fill does not have a numeric height property')
 
64
                        assert(type(x) == 'number', 'visible tile does not have a numeric x property')
 
65
                        assert(type(y) == 'number', 'visible tile does not have a numeric y property')
 
66
                        assert(type(self.width) == 'number', 'visible tile does not have a numeric width property')
 
67
                        assert(type(self.height) == 'number', 'visible tile does not have a numeric height property')
67
68
                end
68
69
 
69
70
                if not self.image then return end
99
100
                if colored then
100
101
                        love.graphics.setColor(255, 255, 255, 255)
101
102
                end
102
 
                        
103
 
                Sprite.draw(self, x, y)
104
103
        end,
105
104
 
106
105
        __tostring = function (self)