Ignore:
Timestamp:
09/03/13 22:11:29 (8 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
36393136643335623263643463383636653936323032346665663964626331313364383064316631
Message:

Pass display offset to overlays for when the display is larger than the level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r209 r211  
    9191        self.game_object = game_object
    9292
    93     def render(self, surface):
     93    def render(self, surface, display_offset):
    9494        pass
    9595
     
    103103        self.widget = LabelWidget((20, 20), self.text)
    104104
    105     def render(self, surface):
     105    def render(self, surface, display_offset):
     106        x, y = 20, 20
     107        if display_offset[0] < 0:
     108            x += abs(display_offset[0])
     109        if display_offset[1] < 0:
     110            y += abs(display_offset[1])
     111        self.widget.rect.topleft = (x, y)
    106112        self.widget.draw(surface)
    107113
Note: See TracChangeset for help on using the changeset viewer.