예제 #1
0
 def _show(self):        
     if globals.curcursor == self and cursor._enabled:
         self._visible = 1
         #Check if we need to load the file
         if self._cursorsurface == None:
             self._cursorsurface = globals.loadimage( FilePath(os.path.join(parameters.getcursorpath(), self._file),
                                                               None, self._encrypted, isAbsolute=True) )
예제 #2
0
    def update(self, file = None, datfile = None, encryption = None, alpha = None, hotspot = None, trans = None):

        #Update settings
        if file != None:
            self._file = file
        if datfile != None:
            self._datfile = datfile
        if encryption != None:
            self._encryption = encryption
        if alpha != None:
            self._alpha = alpha
        if hotspot != None:
            self._hotspot = hotspot
        if trans != None:
            self._trans = trans
        #If any of these changed, we need to reload the file
        if file != None or datfile != None or encryption != None or alpha != None:
            self._cursorsurface = globals.loadfile(parameters.getcursorpath(), self._file, self._datfile, self._encrypted)
            self._cursorsurface.set_colorkey(self._cursorsurface.get_at(self._alpha))
예제 #3
0
 def __init__(self, name, file = None, datfile = None, encrypted = 0, alpha = (0,0), hotspot = (0,0), trans = 'none'):
     #File info
     self._file = file
     self._datfile = datfile
     self._encrypted = encrypted
     #Alpha pos
     self._alpha = alpha
     #Hotspot pos
     self._hotspot = hotspot
     #Default Transition
     self._transition = trans
     #Cursor name
     self._name = name
     #Cursor Surface
     self._cursorsurface = None
     #Visible state
     self._visible = 0
     
     self._cursorsurface = globals.loadimage( FilePath(os.path.join(parameters.getcursorpath(), self._file),
                                                       None, self._encrypted, isAbsolute=True) )
      
     #Add cursor to the dictionary of cursors for later lookup
     globals.cursors[name] = self