コード例 #1
0
 def loadAvatarImage(self, path, timestamp):
   """ Loads the item's image.
   imagePath: item's image path.
   """
   image = "standing_bottomright_0001"
   if not timestamp == "":
     image += "_"+str(timestamp)
   imageName = os.path.join(path, image)  
   self.imgPath = GG.genteguada.GenteGuada.getInstance().getDataPath(imageName)  
   pos = self.__position
   scrPos = GG.utils.p3dToP2d(pos, self.anchor)
   zOrder = (pow(pos[0], 2) + pow(pos[1], 2))*10
   self.__img = guiobjects.getSprite(imageName, scrPos, zOrder)
コード例 #2
0
 def __init__(self, model, topLeft, bottomRight, position, img, hud):
   """ Class constructor.
   model: tile model.
   topLeft: top left tile coord.
   bottomRight: lower right tile coord.
   position: tile position.
   img: tile image.
   hud: hud handler.
   """
   isoview.IsoView.__init__(self, model, None)
   self.__topLeft = topLeft
   self.__bottomRight = bottomRight
   self.__position = position
   self.__hud = hud
   self.__img = guiobjects.getSprite(img, GG.utils.p3dToP2d(position, GG.utils.FLOOR_SHIFT), -1)
コード例 #3
0
 def loadImage(self, imagePath=None):
   """ Loads the item's image.
   imagePath: item's image path.
   """
   if imagePath is None:
     imagePath = self.getModel().getImagePath()
   if not self.__imageName: 
     self.__imageName = self.getModel().getSpriteName()
   imageName = os.path.join(imagePath, self.__imageName)  
   self.imgPath = GG.genteguada.GenteGuada.getInstance().getDataPath(imageName)  
   self.anchor = guiobjects.getOffset(self.imgPath)
   self.topAnchor = guiobjects.getTopOffset(self.anchor, imageName)
   pos = self.__position
   scrPos = GG.utils.p3dToP2d(pos, self.anchor)
   zOrder = (pow(pos[0], 2) + pow(pos[1], 2))*10
   self.__img = guiobjects.getSprite(imageName, scrPos, zOrder)
コード例 #4
0
 def __init__(self, model, screen, isohud, name=None):
     """ Class constructor.
 model: inventory item model.
 screen: screen handler.
 isohud: isometric view hud handler.
 """
     isoview.IsoView.__init__(self, model, screen)
     self.__spriteName = model.spriteInventory
     if name:
         self.__label = name
     else:
         self.__label = model.getName()
     self.__count = 0
     self.__isohud = isohud
     imgPath = GG.genteguada.GenteGuada.getInstance().getDataPath(model.spriteInventory)
     self.__img = guiobjects.getSprite(model.spriteInventory, None, 10001)
コード例 #5
0
 def __init__(self, model, screen, isohud, name=None):
     """ Class constructor.
 model: inventory item model.
 screen: screen handler.
 isohud: isometric view hud handler.
 """
     isoview.IsoView.__init__(self, model, screen)
     self.__spriteName = model.spriteInventory
     if name:
         self.__label = name
     else:
         self.__label = model.getName()
     self.__count = 0
     self.__isohud = isohud
     imgPath = GG.genteguada.GenteGuada.getInstance().getDataPath(
         model.spriteInventory)
     self.__img = guiobjects.getSprite(model.spriteInventory, None, 10001)