def GameDraw(DISPLAY): global PlayButton global SettingsButton global CommonScreenObj global ControlsInitialized global IntroSpriteButton CommonScreenObj = DISPLAY if ControlsInitialized: gameObjs.Draw_Panel(DISPLAY, (Animation_Value, 0, 300, DISPLAY.get_height())) gameMain.DefaultCnt.FontRender( DISPLAY, "/PressStart2P.ttf", 18, gameMain.DefaultCnt.Get_RegKey("/strings/main_menu/game_title"), (240, 250, 250), Animation_Value + 15, 20, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) PlayButton.Render(DISPLAY) SettingsButton.Render(DISPLAY) IntroSpriteButton.Render(DISPLAY) gameMain.DefaultCnt.FontRender( DISPLAY, "/PressStart2P.ttf", 10, gameMain.DefaultCnt.Get_RegKey("/strings/main_menu/about"), (240, 250, 250), IntroSpriteButton.Rectangle[0] + IntroSpriteButton.Rectangle[2] + 5, IntroSpriteButton.Rectangle[1] + 3, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) tipsWindow.Draw(DISPLAY)
def GameDraw(DISPLAY): global Current_Category global ElementsY global ElementsX global OptionsScreen_UpDownCategory global CurrentCategoryUpdate # -- Draw the Background -- # gameObjs.Draw_Panel(DISPLAY, (ElementsX, ElementsY, 558, 258)) # -- Render the Title Text -- # gameMain.shape.Shape_Rectangle(DISPLAY, (1, 22, 39), (ElementsX, ElementsY, 558, 22)) gameMain.DefaultCnt.FontRender( DISPLAY, "/PressStart2P.ttf", 15, gameMain.DefaultCnt.Get_RegKey("/strings/settings/category/{0}".format( str(Current_Category))), (246, 247, 248), ElementsX + 5, ElementsY + 4, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) # -- Render Close Button -- # OptionsScreen_CloseButton.Render(DISPLAY) # -- Render UpDown Button -- # OptionsScreen_UpDownCategory.Render(DISPLAY) # -- Render Categorys -- # CurrentCategoryUpdate.Render(DISPLAY)
def Draw(DISPLAY): global ResultSurface global TextGrind_Text # -- Set Position -- # IncomingLogPos = (DISPLAY.get_width() - 355, ReceiveLog_Y_Offset + DISPLAY.get_height() - 355) # -- Update the Surface -- # ResultSurface = pygame.Surface((350, 350), pygame.SRCALPHA) # -- Render the Background -- # gameObjs.Draw_Panel( DISPLAY, (IncomingLogPos[0], IncomingLogPos[1], ResultSurface.get_width(), ResultSurface.get_height())) # -- Draw the Texts -- # for x, TextGrind_TxT in enumerate(TextGrind_Text): # -- Render Object -- # ObjOpacity = TextGrind_Y[x] * 2 gameMain.DefaultCnt.FontRender( ResultSurface, "/PressStart2P.ttf", TextGrind_FontSize[x], TextGrind_TxT, TextGrind_TextColor[x], TextGrind_X[x], TextGrind_Y[x], Opacity=ObjOpacity, antialias=gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) if gameMain.DefaultCnt.Get_RegKey("/OPTIONS/scanline_effect"): for y in range(0, 175): gameMain.shape.Shape_Line(ResultSurface, (0, 0, 0), 3, 4 + y * 2, ResultSurface.get_width() - 3, 4 + y * 2, 1) gameMain.shape.Shape_Rectangle(ResultSurface, (0, 0, 0), (0, 24, ResultSurface.get_width(), ResultSurface.get_height() - 24), 5, 8) # -- Render the Container Title -- # gameMain.shape.Shape_Rectangle(ResultSurface, (0, 12, 30), (0, 0, 350, 24)) gameMain.DefaultCnt.FontRender( ResultSurface, "/PressStart2P.ttf", 18, gameMain.DefaultCnt.Get_RegKey("/strings/game/receiving_log"), (250, 250, 255), 3, 3) # -- Blit everthing to screen -- # DISPLAY.blit(ResultSurface, IncomingLogPos) ReceiveLog_CloseButton.Render(DISPLAY)
def Draw(HUD_Surface): global SecondsText global DateText global ClockBoxPos global ClockBox global CommonSurface if CommonSurface == None: CommonSurface = HUD_Surface return CommonSurface = HUD_Surface # -- Render Background -- # gtk.Draw_Panel(ClockBox, (0, 0, ClockBoxPos[2] - 2, ClockBoxPos[3] - 2), True) # -- Locations -- # TimeTextY = 7 DayTextY = 22 # -- Time -- # gameMain.DefaultCnt.FontRender( ClockBox, "/PressStart2P.ttf", 10, SecondsText, (0, 0, 0), ClockBox.get_width() / 2 - gameMain.DefaultCnt.GetFont_width( "/PressStart2P.ttf", 10, SecondsText) / 2 + 2, TimeTextY - 2, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) gameMain.DefaultCnt.FontRender( ClockBox, "/PressStart2P.ttf", 10, SecondsText, (230, 230, 230), ClockBox.get_width() / 2 - gameMain.DefaultCnt.GetFont_width( "/PressStart2P.ttf", 10, SecondsText) / 2, TimeTextY, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) # -- Day -- # gameMain.DefaultCnt.FontRender( ClockBox, "/PressStart2P.ttf", 10, DateText, (0, 0, 0), ClockBox.get_width() / 2 - gameMain.DefaultCnt.GetFont_width("/PressStart2P.ttf", 10, DateText) / 2 + 2, DayTextY - 2, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) gameMain.DefaultCnt.FontRender( ClockBox, "/PressStart2P.ttf", 10, DateText, (230, 230, 230), ClockBox.get_width() / 2 - gameMain.DefaultCnt.GetFont_width("/PressStart2P.ttf", 10, DateText) / 2, DayTextY, gameMain.DefaultCnt.Get_RegKey("/OPTIONS/font_aa")) gameMain.shape.Shape_Rectangle(ClockBox, (0, 0, 0), (0, 0, ClockBoxPos[2], ClockBoxPos[3]), 3, 5) HUD_Surface.blit(ClockBox, (ClockBoxPos[0], ClockBoxPos[1]))
def Draw(Display): global DialogRectangle global CommonDisplay global CommonDisplayInitialized global CommonDisplayScreenPos global DialogOpctAnim_AnimNumb global MessageTitle global BGDarkSurfaceCreated global BGDarkSurface # -- Draw the Copy of Screen -- # Draw_ScreenshotOfGameScreen(Display) if CommonDisplayInitialized: # -- Draw the Background -- # gtk.Draw_Panel(CommonDisplay, DialogRectangle) # -- Draw the Titlebar -- # gameMain.shape.Shape_Rectangle(CommonDisplay, (10, 32, 49), (0, 0, DialogRectangle[2], 25)) gameMain.DefaultCnt.FontRender( CommonDisplay, "/PressStart2P.ttf", 18, MessageTitle, (240, 240, 240), DialogRectangle[2] / 2 - gameMain.DefaultCnt.GetFont_width( "/PressStart2P.ttf", 18, MessageTitle) / 2, 4) if Subscreen == 1: subscreen1.Draw(CommonDisplay) CommonDisplayScreenPos = (Display.get_width() / 2 - 395 / 2, Display.get_height() / 2 - 150 / 2 - DialogOpctAnim_AnimNumb * 2.5 / 3.10) if not BGDarkSurfaceCreated: BGDarkSurfaceCreated = True BGDarkSurface = pygame.Surface( (Display.get_width(), Display.get_height())) BGDarkSurface.set_alpha(DialogOpctAnim_AnimOpacity) Display.blit(BGDarkSurface, (0, 0)) Display.blit(CommonDisplay, CommonDisplayScreenPos)
def GameDraw(DISPLAY): # -- Engine Required Function global DefaultDisplay global LastErrorText global LastErrorTextDeltaTime global LastErrorTextEnabled global DefaultDisplay global CursorW global CursorH global ClearColor global ErrorMessageEnabled global ErrorMessage global ErrorMessageDelay global OverlayDialogEnabled global ScreenLastFrame global CurrentUpdate global DefaultCnt # -- Clear the Surface -- # DefaultDisplay = DISPLAY DISPLAY.fill(ClearColor) if not DefaultCnt.Get_RegKey("/OPTIONS/debug_enabled", bool): try: if not OverlayDialogEnabled: CurrentUpdate.GameDraw(DefaultDisplay) ScreenLastFrame = DefaultDisplay.copy() else: dialog.Draw(DISPLAY) except Exception as ex: WriteErrorLog(ex, "GameDraw", False) else: if not OverlayDialogEnabled: CurrentUpdate.GameDraw(DefaultDisplay) ScreenLastFrame = DefaultDisplay.copy() else: dialog.Draw(DISPLAY) # -- Render the Error Message -- # if ErrorMessageEnabled: ErrorMessageDelay += 1 gameObjs.Draw_Panel(DISPLAY, (0, 5, DISPLAY.get_width(), gameMain.DefaultCnt.GetFont_height("/PressStart2P.ttf", gameMain.DefaultCnt.Get_RegKey("/props/error_message_text_size"), ErrorMessage))) SPRITE.FontRender(DISPLAY, "/PressStart2P.ttf", gameMain.DefaultCnt.Get_RegKey("/props/error_message_text_size", int), ErrorMessage, (150, 50, 50), 0, 5, False) if ErrorMessageDelay >= gameMain.DefaultCnt.Get_RegKey("/props/error_message_delay_max", int): ErrorMessageDelay = 0 ErrorMessageEnabled = False # -- Render Cursor -- # gameMain.DefaultCnt.ImageRender(DefaultDisplay, "/cursors/{0}.png".format(str(Cursor_CurrentLevel)), Cursor_Position[0], Cursor_Position[1]) # -- Render the Transition -- # transition.Render(DefaultDisplay) if DefaultCnt.Get_RegKey("/OPTIONS/debug_enabled", bool): gameMain.DefaultCnt.FontRender(DefaultDisplay, "/PressStart2P.ttf", 10, "FPS: {0}".format(utils.FormatNumber(MAIN.clock.get_fps())), (240, 240, 240), 5, 5, backgroundColor=(5, 8, 13)) # -- Render the Error Overlay -- # if LastErrorTextEnabled: LastErrorTextDeltaTime += 1 gameMain.DefaultCnt.FontRender(DISPLAY, "/PressStart2P.ttf", 9, LastErrorText, (200, 0, 0), 5, 5, False, (10, 20, 27)) if LastErrorTextDeltaTime >= 1500: LastErrorTextDeltaTime = 0 LastErrorTextEnabled = False LastErrorText = ""