Changeset 211:434b5a3aaaff for nagslang


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

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.