Beispiel #1
0
 def render(self, deltaTime):
     titlePosition = (myDisplayManager.getCenterPosition(
         self._titleSurface.get_size())[0], self._margin)
     myDisplayManager.display(self._titleSurface, titlePosition)
     index = 0
     for button in self._buttons:
         button.setShaking(self._selectedButton == index)
         button.renderButton(deltaTime)
         index += 1
Beispiel #2
0
 def render(self, deltaTime):
     if self._debug:
         self._background.fill((0, 0, 0, 0))
         points = [
             self._position,
             (self._position[0] + self._width, self._position[1]),
             (self._position[0] + self._width, self._position[1] + self._height),
             (self._position[0], self._position[1] + self._height)
         ]
         pygame.draw.lines(self._background, colors.RED, True, points, 2)
         myDisplayManager.display(self._background, (0, 0))
Beispiel #3
0
 def render(self, deltaTime):
     basePosition = self._mapObject.mapToPixel(self._position[0],
                                               self._position[1])
     myDisplayManager.display(
         self._selectorSurface,
         self._mapObject.applyOffset(basePosition[0], basePosition[1]))
     if self._selectedObject:
         objX, objY = self._selectedObject.getPixelPosition()
         if type(self._selectedObject) != PlayerObject:
             objX, objY = self._mapObject.applyOffset(objX, objY)
         myDisplayManager.display(self._selectedSurface, (objX, objY))
Beispiel #4
0
 def render(self, deltaTime):
     surface = self._playerSurface
     """rect = surface.get_rect()
     if self._orientation != 0:
         surface = pygame.transform.rotate(surface, self._orientation)
         newRect = surface.get_rect()
         newRect.center = rect.center
         rect = newRect
     rect.left = self._position[0]
     rect.top = self._position[1]"""
     if self._selected:
         self.selectionElementRender(deltaTime)
     myDisplayManager.display(surface, self._pixelPos)
Beispiel #5
0
    def renderButton(self, deltaTime, position=None):
        """
        Display the button
        :param position: if no position use default
        :return: Nothing
        """
        currentPosition = position if position else self._position
        currentPosition = self.shake(currentPosition, deltaTime)

        buttonSize = self._buttonImg.get_size()
        textSize = self._textSurface.get_size()

        textPosition = ((buttonSize[0] - textSize[0]) / 2 + currentPosition[0],
                        (buttonSize[1] - textSize[1]) / 2 + currentPosition[1])

        myDisplayManager.display(self._buttonImg, currentPosition)
        myDisplayManager.display(self._textSurface, textPosition)
Beispiel #6
0
 def render(self, deltaTime):
     myDisplayManager.display(self._background, (0, 0))
     myDisplayManager.display(self._dialogBackground, self._position)
     positionT = self._position[0] + self._padding
     positionL = self._position[1] + self._padding
     for dialog in self._renderedDialogs[self._currentDialog][
             self._currentSubDialog]:
         dialog.set_alpha(self._currentFading)
         myDisplayManager.display(dialog, (positionT, positionL))
         positionL += dialog.get_size()[1]
Beispiel #7
0
 def render(self, deltaTime, offsetX, offsetY):
     myDisplayManager.display(
         self._surface,
         (self._pixelPos[0] - offsetX, self._pixelPos[1] - offsetY))
Beispiel #8
0
 def render(self, deltaTime):
     myDisplayManager.display(self._background, (0, 0))
     self._mapObject.render(deltaTime)
Beispiel #9
0
 def selectionElementRender(self, deltaTime):
     if self._tacticalMode:
         myDisplayManager.display(self._accessibleCasesSurface,
                                  self._accessibleCasesSurfacePosition)
Beispiel #10
0
 def render(self, deltaTime):
     self.renderCurrentSubBlock()
     myDisplayManager.display(self._textSurface, self._position)