Changeset 34


Ignore:
Timestamp:
04/09/09 13:44:03 (11 years ago)
Author:
tie_parpg
Message:
  • 'T' button now shows the layer grids
File:
1 edited

Legend:

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

    r31 r34  
    8989        keystr = evt.getKey().getAsString().lower() 
    9090 
     91        if keystr == 't': 
     92            self.toggle_renderer ('GridRenderer') 
     93 
    9194    def mousePressed(self, evt): 
    9295        """If a mouse button is pressed down, fife calss this routine 
     
    100103            l.setMapCoordinates(target_mapcoord) 
    101104            self.PC.run(l) 
     105             
     106    def toggle_renderer (self,r_name): 
     107        """Enable or disable the renderer named `r_name`""" 
     108        renderer = self.cameras['main'].getRenderer('GridRenderer') 
     109        renderer.setEnabled(not renderer.isEnabled()) 
    102110 
    103111    def pump(self): 
Note: See TracChangeset for help on using the changeset viewer.