Ignore:
Timestamp:
05/11/09 08:22:15 (11 years ago)
Author:
maximinus_parpg
Message:

Added bhaydens screenshot code.
Added new screenshots folder.
Updated README.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/world.py

    r55 r56  
    1717 
    1818import fife 
     19from datetime import date 
    1920from scripts.common.eventlistenerbase import EventListenerBase 
    2021from loaders import loadMapFile 
     
    6869        self.model=engine.getModel() 
    6970        self.view=self.engine.getView() 
     71        self.rend_backend=self.engine.getRenderBackend() 
    7072        self.filename='' 
    7173        self.transitions=[] 
     
    142144            # logic here does not work, my friend :-( 
    143145            self.cord_render.setEnabled(not self.cord_render.isEnabled()) 
     146        if keyval == key.F7: 
     147            # F7 saves a screenshot to fife/clients/parpg/screenshots 
     148            self.rend_backend.captureScreen("screenshots/screen-%s.png" %  
     149                                             date.today().strftime('%Y-%m-%d')) 
    144150 
    145151    def mousePressed(self, evt): 
    146         """If a mouse button is pressed down, fife calss this routine 
     152        """If a mouse button is pressed down, fife cals this routine 
    147153           Currently we only check for a left click, and we assume this is on 
    148154           the map""" 
    149155        clickpoint = fife.ScreenPoint(evt.getX(), evt.getY()) 
    150156        if (evt.getButton()==fife.MouseEvent.LEFT): 
    151             target_mapcoord=self.cameras['main'].toMapCoordinates(clickpoint, False) 
     157            target_mapcoord=self.cameras['main'].toMapCoordinates(clickpoint, 
     158                                                                  False) 
    152159            target_mapcoord.z = 0 
    153160            l=fife.Location(self.agent_layer) 
Note: See TracChangeset for help on using the changeset viewer.