コード例 #1
0
 def setEyes(self, human, mhstx):
     # TODO this will change, for now eyes might only be compatible with the original skin
     f = open(mhstx, 'rU')
     try:
         subTextures = mh.parseINI(f.read(), [("(","["), (")","]")])
     except:
         log.warning("setEyes(%s)", mhstx, exc_info=True)
         f.close()
         return
     f.close()
     
     texture = mh.getTexture(human.getTexture())
     img = mh.Image(human.getTexture())
     
     for subTexture in subTextures:
         path = os.path.join('data/eyes', subTexture['txt'])
         subImg = mh.Image(path)
         x, y = subTexture['dst']
         img.blit(subImg, x, y)
         
     texture.loadSubImage(img, 0, 0)
     self.eyeTexture = mhstx
コード例 #2
0
    def setEyes(self, human, mhstx):
        # TODO this will change, for now eyes might only be compatible with the original skin
        f = open(mhstx, 'rU')
        try:
            subTextures = mh.parseINI(f.read(), [("(", "["), (")", "]")])
        except:
            log.warning("setEyes(%s)", mhstx, exc_info=True)
            f.close()
            return
        f.close()

        texture = mh.getTexture(human.getTexture())
        img = mh.Image(human.getTexture())

        for subTexture in subTextures:
            path = os.path.join('data/eyes', subTexture['txt'])
            subImg = mh.Image(path)
            x, y = subTexture['dst']
            img.blit(subImg, x, y)

        texture.loadSubImage(img, 0, 0)
        self.eyeTexture = mhstx
コード例 #3
0
 def setEyes(self, human, mhstx):
     # TODO this will change, for now eyes might only be compatible with the original skin
     texture = mh.getTexture(human.getTexture())
     texture.loadSubImage(
         subtextures.combine(mh.Image(human.getTexture()),mhstx), 0, 0)
     self.eyeTexture = mhstx