UI.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:RPG 作者: LugosFingite 项目源码 文件源码
def button(self, y: ctypes.c_int16, action : Action):
        mouse = pygame.mouse.get_pos()
        click = pygame.mouse.get_pressed()

        if 40 < mouse[0] < self.res[0] - 40 and y < mouse[1] < y + 24:
            if click[0] == 0:
                self.MAIN.blit(_button2, (40, y))
            elif click[0] == 1:
                self.MAIN.blit(_button3, (40, y))

                if action.histoireCiblee != None:
                    Histoire.histoire = action.histoireCiblee
                if Histoire.page.son != None:
                    st.stopsound(Histoire.page.son[0])
                Histoire.page = Histoire.chargerpage(action.cible)

        else:
            self.MAIN.blit(_button1, (40, y))

        self._write(action.desc[0], action.desc[1], 20, self.res[0] // 2, y + 13, center = True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号