Blocking Info Renderer

From FIFE development wiki
Revision as of 05:52, 25 March 2012 by Helios2000 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
wiki
Document Data structures Data strucures
Concepts illustrated here are relevant to understand what kind of data FIFE engine is able to process.

Introduction

The BlockingInfoRenderer is a debuger or helper renderer. It can be used to show you which instances on the map have their blocking property set to True. You can only changed the color that is used.


Usage

Same as by the other renderers, you can enable Layers which instances are then checked and if they have a active blocking property there cells are framed. The default color is green, 0,255,0 you can change it with setColor().


Options

getName()

string; gets the name of the renderer


setColor(r, g, b)

changes the used color

r,g,b
integer; color values, range 0-255


Example

Here we active a Layer (agentlayer) and change the color to red (255,0,0)

 # "agentlayer" is the Layer Id to get an instance of fife.Layer()
 # self.map is an instance of fife.Map()
 # self.camera is an instance of fife.Camera()
 
 #get renderer
 renderer = fife.BlockingInfoRenderer.getInstance(self.camera)
 
 #change color to red
 renderer.setColor(255, 0, 0)
 
 #fetch layer
 layer = self.map.getLayer("agentlayer")
 
 #activate a layer
 renderer.addActiveLayer(layer)