Changeset 211:434b5a3aaaff


Ignore:
Timestamp:
Sep 3, 2013, 10:11:29 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
6916d35b2cd4c866e962024fef9dbc113d80d1f1
Message:

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

Location:
nagslang
Files:
2 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
  • nagslang/screens/area.py

    r192 r211  
    174174        for overlay in self._level.overlay_drawables:
    175175            if overlay.is_visible():
    176                 overlay.render(surface)
     176                overlay.render(surface, render_rect.topleft)
    177177
    178178    def tick_protagonist(self):
Note: See TracChangeset for help on using the changeset viewer.