/ld27

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

« back to all changes in this revision

Viewing changes to zoetrope/core/group.lua

  • Committer: Josh C
  • Date: 2014-07-03 14:42:45 UTC
  • Revision ID: josh@9ix.org-20140703144245-zsf2q3in0zb1drvo
changes for love 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        -- sprites at their normal position, set both x and y to 1.
51
51
        translateScale = { x = 1, y = 1 },
52
52
 
53
 
  -- an actual love.graphics.translate call
54
 
  realTranslate = { x = 0, y = 0 },
55
 
 
56
53
        -- Property: scale
57
54
        -- Zooms in or out all drawing operations in the group, centering them with
58
55
        -- respect to the <origin> property.
537
534
        --              x - x offset in pixels
538
535
        --              y - y offset in pixels
539
536
 
540
 
        draw = function (self, x, y, yield)
 
537
        draw = function (self, x, y)
541
538
                if not self.visible then return end
542
539
                x = x or self.translate.x
543
540
                y = y or self.translate.y
546
543
                local scrollY = y * self.translateScale.y
547
544
                local appWidth = the.app.width
548
545
                local appHeight = the.app.height
549
 
                local scaled = self.scale ~= 1 or self.distort.x ~= 1 or self.distort.y ~= 1 or self.realTranslate.x ~= 0 or self.realTranslate.y ~= 0
 
546
                local scaled = self.scale ~= 1 or self.distort.x ~= 1 or self.distort.y ~= 1
550
547
 
551
548
                if self.effect then
552
549
                        if self.effectType == 'screen' then
563
560
                        local scaleY = self.scale * self.distort.y
564
561
 
565
562
                        love.graphics.push()
566
 
 
567
 
      love.graphics.translate(self.realTranslate.x, self.realTranslate.y)
568
 
 
569
563
                        love.graphics.translate(self.origin.x, self.origin.y)
570
564
                        love.graphics.scale(scaleX, scaleY)
571
565
                        love.graphics.translate(- self.origin.x, - self.origin.y)
589
583
                        end
590
584
                end
591
585
 
592
 
    if yield then yield(self, x, y) end
593
 
 
594
586
                if scaled then
595
587
                        love.graphics.pop()
596
588
                end