comparison demos/rio_de_hola/scripts/world.py @ 432:4f2752d45458

This changes the behavior of Camera::resetRenderers(). It will no longer activate all layers for every renderer. This is now up to the clients to do. It also adds some code to the map loader that will automatically activate the layers in the InstanceRenderer. Clients that use the any of the renderers will now have to activate the layer they want to use. Also updated rio_de_hola and the editor to reflect changes. fixes[t:457]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 24 Feb 2010 20:03:52 +0000
parents 9d94f4676d17
children e29853880e87
comparison
equal deleted inserted replaced
431:f44b149f63e7 432:4f2752d45458
210 # You'll se that for our demo we use a image font, so we have to specify the font glyphs 210 # You'll se that for our demo we use a image font, so we have to specify the font glyphs
211 # for that one. 211 # for that one.
212 renderer = fife.FloatingTextRenderer.getInstance(self.cameras['main']) 212 renderer = fife.FloatingTextRenderer.getInstance(self.cameras['main'])
213 textfont = self.engine.getGuiManager().createFont('fonts/rpgfont.png', 0, str(TDS.readSetting("FontGlyphs", strip=False))); 213 textfont = self.engine.getGuiManager().createFont('fonts/rpgfont.png', 0, str(TDS.readSetting("FontGlyphs", strip=False)));
214 renderer.changeDefaultFont(textfont) 214 renderer.changeDefaultFont(textfont)
215 215 renderer.activateAllLayers(self.map)
216
217 # Activate the grid renderer on all layers
218 renderer = self.cameras['main'].getRenderer('GridRenderer')
219 renderer.activateAllLayers(self.map)
220
216 # The small camera shouldn't be cluttered by the 'humm di dums' of our hero. 221 # The small camera shouldn't be cluttered by the 'humm di dums' of our hero.
217 # So we disable the renderer simply by setting its font to None. 222 # So we disable the renderer simply by setting its font to None.
218 renderer = fife.FloatingTextRenderer.getInstance(self.cameras['small']) 223 renderer = fife.FloatingTextRenderer.getInstance(self.cameras['small'])
219 renderer.changeDefaultFont(None) 224 renderer.changeDefaultFont(None)
225
220 226
221 # The following renderers are used for debugging. 227 # The following renderers are used for debugging.
222 # Note that by default ( that is after calling View.resetRenderers or Camera.resetRenderers ) 228 # Note that by default ( that is after calling View.resetRenderers or Camera.resetRenderers )
223 # renderers will be handed all layers. That's handled here. 229 # renderers will be handed all layers. That's handled here.
224 renderer = self.cameras['main'].getRenderer('CoordinateRenderer') 230 renderer = self.cameras['main'].getRenderer('CoordinateRenderer')