Ignore:
Timestamp:
02/22/11 23:11:13 (8 years ago)
Author:
technomage
Message:

Patch by Technomage

  • Added a loadFonts method to PARPGApplication which is called upon instantiation and loads all .fontdef files used to define fonts for PyChan?;
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/application.py

    r738 r742  
    1616and the basic Listener for PARPG """ 
    1717 
     18import os 
    1819 
    1920from fife import fife 
     
    128129        self.model.getDialogues() 
    129130        self.view = MainMenuView(self.engine, self.model) 
     131        self.fonts_directory = self._setting.get("PARPG", "FontsDirectory") 
     132        self.loadFonts(self.fonts_directory) 
    130133        self.event_listener = EventListener(self.engine) 
    131134        self.controllers = [] 
     
    142145        #start_map = self._setting.get("PARPG", "Map") 
    143146        #self.model.changeMap(start_map) 
     147 
     148    def loadFonts(self, fonts_directory): 
     149        file_names = os.listdir(fonts_directory) 
     150        for file_name in file_names: 
     151            base_name, extension = os.path.splitext(file_name) 
     152            if extension == '.fontdef': 
     153                pychan.loadFont(file_name) 
    144154 
    145155    def createListener(self): 
Note: See TracChangeset for help on using the changeset viewer.