def draw(self): pyxel.cls(0) self.drawStar() pyxel.pal() x1 = 72 x2 = MENU_VALUE_X Drawing.showTextHCenter(8, "OPTION") y = 50 gcommon.setMenuColor(OPTIONMENU_BGM_VOL, self.menuPos) Drawing.showText(x1, y, "BGM VOLUME") Drawing.showText(x2, y, str(Settings.bgmVolume).rjust(2)) if OPTIONMENU_BGM_VOL == self.menuPos: #gcommon.drawUpDownMarker(x2 -10, y) Drawing.drawUpDownMarker2(x2 -10, y, 0, 10, Settings.bgmVolume) y += 20 gcommon.setMenuColor(OPTIONMENU_SOUND_VOL, self.menuPos) Drawing.showText(x1, y, "SE VOLUME") se = "ON " if Settings.soundVolume > 0 else "OFF" Drawing.showText(x2, y, se) if OPTIONMENU_SOUND_VOL == self.menuPos: leftMarker = (Settings.soundVolume > 0) Drawing.drawLeftMarker(x2 -10, y, leftMarker) Drawing.drawRightMarker(x2 +len(se)*8 + 2, y, not leftMarker) y += 20 gcommon.setMenuColor(OPTIONMENU_MOUSE_ENABLED, self.menuPos) Drawing.showText(x1, y, "MOUSE") mouseOnOff = "ON " if Settings.mouseEnabled else "OFF" Drawing.showText(x2, y, mouseOnOff) if OPTIONMENU_MOUSE_ENABLED == self.menuPos: leftMarker = (Settings.mouseEnabled == True) Drawing.drawLeftMarker(x2 -10, y, leftMarker) Drawing.drawRightMarker(x2 +len(se)*8 + 2, y, not leftMarker) y += 20 gcommon.setMenuColor(OPTIONMENU_SCORE_RANKIG, self.menuPos) Drawing.showTextHCenter(y, "SCORE RANKING") y += 20 gcommon.setMenuColor(OPTIONMENU_EXIT, self.menuPos) Drawing.showTextHCenter(y, "EXIT") Drawing.setBrightness1() pyxel.blt(32, 48 + self.menuPos * 20, 4, 32, 48 + self.menuPos * 20, 192, 12) pyxel.pal() if self.mouseManager.visible: self.mouseManager.drawMenuCursor()
def drawMenu(self, startFlag, rate): pyxel.pal() y = __class__.menu_top_y if rate < 1.0: gcommon.setMenuColor(0, -1) else: if (startFlag and self.cnt & 2 == 0) or (startFlag == False and self.menuPos == 0 and self.cnt & 16 == 0): pyxel.pal(7, 8) pyxel.pal(5, 4) else: gcommon.setMenuColor(0, self.menuPos) text = gcommon.difficultyText[self.difficulty] + " START" Drawing.showTextRateHCenter(y, text, rate) if rate == 1.0 and self.menuPos == 0: Drawing.drawLeftMarker(128 - 8 - 48 - 4, y, self.difficulty > 0) Drawing.drawRightMarker(128 + 48 + 4, y, self.difficulty < 2) pyxel.pal() y += 15 gcommon.setMenuColor(1, self.menuPos) Drawing.showTextRateHCenter(y, "CUSTOM START", rate) y += 15 gcommon.setMenuColor(2, self.menuPos) Drawing.showTextRateHCenter(y, "BOSS RUSH START", rate) y += 15 gcommon.setMenuColor(3, self.menuPos) Drawing.showTextRateHCenter(y, "OPTION", rate) y += 15 gcommon.setMenuColor(4, self.menuPos) Drawing.showTextRateHCenter(y, "EXIT", rate) if rate == 1.0: Drawing.setBrightness1() pyxel.blt(48, __class__.menu_top_y - 2 + self.menuPos * 15, 4, 48, __class__.menu_top_y - 2 + self.menuPos * 15, 160, 12) pyxel.pal()
def drawPauseMenu(self): # PAUSEメニューはベタ描き pyxel.rect(127 - 40, 192 / 2 - 32, 80, 60, 0) pyxel.rectb(127 - 39, 192 / 2 - 31, 78, 58, 7) pyxel.rect(127 - 37, 192 / 2 - 29, 74, 8, 1) pyxel.text(127 - 40 + 28, 192 / 2 - 32 + 4, "PAUSE", 7) pyxel.rect(127 - 40 + 4, 192 / 2 - 32 + 15 + self.pauseMenuPos * 10, 80 - 8, 8, 2) pyxel.text(127 - 32 + 4, 192 / 2 - 32 + 16, "CONTINUE", 7) #MOUSE y = 192 / 2 - 32 + 26 pyxel.text(127 - 32 + 4, y, "MOUSE", 7) leftMarker = (Settings.mouseEnabled == True) pyxel.text(127 - 32 + 10 + 36, y, "ON " if Settings.mouseEnabled else "OFF", 7) Drawing.drawLeftMarker(127 - 32 + 10 + 26, y - 1, leftMarker) Drawing.drawRightMarker(127 - 32 + 10 + 48, y - 1, not leftMarker) pyxel.text(127 - 32 + 4, 192 / 2 - 32 + 36, "TITLE", 7) pyxel.text(127 - 32 + 4, 192 / 2 - 32 + 46, "EXIT", 7)
def draw(self): pyxel.cls(0) self.drawStar() Drawing.showTextHCenter(32, "BOSS RUSH START") x1 = 48 x2 = MENU_VALUE_X x3 = START_X idx = 0 self.setOptionColor(MENU_PLAYER_STOCK) Drawing.showText(x1, self.menuYList[MENU_PLAYER_STOCK], "PLAYER STOCK") Drawing.showText(x2, self.menuYList[MENU_PLAYER_STOCK], str(Settings.playerStock).rjust(2)) if MENU_PLAYER_STOCK == self.menuPos: Drawing.drawUpDownMarker2(x2 -10, self.menuYList[idx], 1, 99, Settings.playerStock) idx += 1 self.setOptionColor(MENU_WEAPON_TYPE) Drawing.showText(x1, self.menuYList[MENU_WEAPON_TYPE], "WEAPON") if Settings.weaponType == gcommon.WeaponType.TYPE_A: Drawing.showText(x2, self.menuYList[MENU_WEAPON_TYPE], "TYPE A") else: Drawing.showText(x2, self.menuYList[MENU_WEAPON_TYPE], "TYPE B") if MENU_WEAPON_TYPE == self.menuPos: typeA = (Settings.weaponType == gcommon.WeaponType.TYPE_A) Drawing.drawLeftMarker(x2 -10, self.menuYList[MENU_WEAPON_TYPE], not typeA) Drawing.drawRightMarker(x2 +6*8 +2, self.menuYList[MENU_WEAPON_TYPE], typeA) if Settings.weaponType == gcommon.WeaponType.TYPE_B: self.setOptionColor(MENU_WEAPON_OPTION) Drawing.showText(x1, self.menuYList[MENU_WEAPON_OPTION], " MULTIPLE") Drawing.showText(x2, self.menuYList[MENU_WEAPON_OPTION], str(Settings.multipleCount).rjust(2)) if MENU_WEAPON_OPTION == self.menuPos: Drawing.drawUpDownMarker2(x2 -10, self.menuYList[MENU_WEAPON_OPTION], 0, 99, Settings.multipleCount) # idx += 1 # self.setOptionColor(MENU_START_STAGE) # Drawing.showText(x1, self.menuYList[MENU_START_STAGE], "START STAGE") # Drawing.showText(x2, self.menuYList[MENU_START_STAGE], gcommon.stageList[self.stageIndex]) # if MENU_START_STAGE == self.menuPos: # Drawing.drawUpDownMarker2(x2 -10, self.menuYList[MENU_START_STAGE], 0, len(gcommon.stageList)-1, self.stageIndex) idx += 1 text = "START" if self.state == 0: if self.state == 0 and self.menuPos == MENU_GAME_START and self.cnt & 16 == 0: pyxel.pal(7, 8) pyxel.pal(5, 4) else: self.setOptionColor(MENU_GAME_START) Drawing.showTextHCenter(self.menuYList[MENU_GAME_START], text) else: if self.cnt & 2 == 0: pyxel.pal(7, 8) pyxel.pal(5, 4) Drawing.showTextHCenter(self.menuYList[MENU_GAME_START], text) pyxel.pal() idx += 1 # if self.state == 0: # self.setOptionColor(MENU_GAME_START) # Drawing.showTextHCenter(self.menuYList[3], "GAME START") # else: # if self.cnt & 2 == 0: # pyxel.pal(7, 8) # Drawing.showTextHCenter(self.menuYList[3], "GAME START") # if self.cnt & 2 == 0: # pyxel.pal() self.setOptionColor(MENU_EXIT) Drawing.showTextHCenter(self.menuYList[MENU_EXIT], "EXIT") Drawing.setBrightness1() y = self.menuYList[self.menuPos] -2 pyxel.blt(16, y, 4, 16, y, 224, 12) pyxel.pal() if self.mouseManager.visible: self.mouseManager.drawMenuCursor()
def draw(self): pyxel.cls(0) self.drawStar() Drawing.showTextHCenter(8, "SCORE RANKING") self.setOptionColor(0) if self.gameMode == gcommon.GAMEMODE_NORMAL: cols = __class__.colXList Drawing.showTextHCenter(__class__.MARKER_Y, gcommon.difficultyText[self.difficulty]) Drawing.drawLeftMarker(__class__.LEFT_MARKER_X, __class__.MARKER_Y, self.difficulty > 0) Drawing.drawRightMarker(__class__.RIGHT_MARKER_X, __class__.MARKER_Y, True) else: cols = __class__.colXList2 Drawing.showTextHCenter(__class__.MARKER_Y, "BOSS RUSH") Drawing.drawLeftMarker(__class__.LEFT_MARKER_X, __class__.MARKER_Y, True) Drawing.drawRightMarker(__class__.RIGHT_MARKER_X, __class__.MARKER_Y, False) self.setOptionColor(1) Drawing.showTextHCenter(__class__.EXIT_Y, "EXIT") pyxel.pal() # カラムヘッダー pyxel.pal(7, 12) for i, x in enumerate(cols): Drawing.showText(x, 40, __class__.colNameList[i]) pyxel.pal() if self.gameMode == gcommon.GAMEMODE_NORMAL: if self.difficulty == gcommon.DIFFICULTY_EASY: rankingList = self.rakingManager.easyRanking elif self.difficulty == gcommon.DIFFICULTY_NORMAL: rankingList = self.rakingManager.normalRanking else: rankingList = self.rakingManager.hardRanking else: rankingList = self.rakingManager.bossRushRanking if rankingList == None: rankingList = [] sy = 56 dy = 12 for i in range(10): name = "---" score = "--------" destroyed = "--" stage = " -" weaponType = "-" if i < len(rankingList): name = rankingList[i].name score = str(rankingList[i].score).rjust(8) destroyed = str(rankingList[i].destroyed).rjust(2) if rankingList[i].stage == "-1": stage = "CLEAR" else: stage = " " + str(rankingList[i].stage) if rankingList[i].weaponType == "0": weaponType = "A" elif rankingList[i].weaponType == "1": weaponType = "B" Drawing.showText(cols[0], sy + i * dy, __class__.rankList[i]) Drawing.showText(cols[1], sy + i * dy, name) Drawing.showText(cols[2], sy + i * dy, score) Drawing.showText(cols[3], sy + i * dy, stage) if self.gameMode == gcommon.GAMEMODE_BOSSRUSH: Drawing.showText(cols[4], sy + i * dy, destroyed) Drawing.showText(cols[5], sy + i * dy, weaponType) Drawing.setBrightness1() rect = self.menuRects[self.menuPos] pyxel.blt(rect.left, rect.top, 4, rect.left, rect.top, rect.getWidth(), rect.getHeight()) pyxel.pal() # マウスカーソル if self.mouseManager.visible: self.mouseManager.drawMenuCursor()