当前位置: 首页>>代码示例>>Python>>正文


Python pygame.K_i方法代码示例

本文整理汇总了Python中pygame.K_i方法的典型用法代码示例。如果您正苦于以下问题:Python pygame.K_i方法的具体用法?Python pygame.K_i怎么用?Python pygame.K_i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygame的用法示例。


在下文中一共展示了pygame.K_i方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_i [as 别名]
def update(self, frameNumber, editor):
        for event, pos in editor.context.events:
            if event.type == pygame.KEYDOWN:
                bone = editor.getActiveBone()
                key = event.key
                if key == pygame.K_i:
                    if bone:
                        if event.mod & pygame.KMOD_ALT:
                            if bone.name in self.frames[frameNumber].keys:
                                del self.frames[frameNumber].keys[bone.name]
                        else:
                            key = self.frames[frameNumber].getBoneKey(bone.name)
                            copyKeyData(bone, key)
                        self.dirty = True
                elif key == pygame.K_o:
                    if bone:
                        data = self.getBoneData(bone.name)
                        data.repeat = not data.repeat
                        self.dirty = True
                elif key == pygame.K_p:
                    if bone:
                        data = self.getBoneData(bone.name)
                        data.reversed = not data.reversed
                        self.dirty = True 
开发者ID:bitsawer,项目名称:renpy-shader,代码行数:26,代码来源:skinnedanimation.py

示例2: SetXYABButtons

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_i [as 别名]
def SetXYABButtons(mode):
    if mode == "snes":
        GameShell["Y"] = pygame.K_u
        GameShell["X"] = pygame.K_i
        GameShell["B"] = pygame.K_j
        GameShell["A"] = pygame.K_k
    else:
        GameShell["X"] = pygame.K_u
        GameShell["Y"] = pygame.K_i
        GameShell["A"] = pygame.K_j
        GameShell["B"] = pygame.K_k 
开发者ID:clockworkpi,项目名称:launcher,代码行数:13,代码来源:keys_def.py

示例3: key_event_up

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_i [as 别名]
def key_event_up(event):
    global penSize, undoed, holdingCTRL, colorScheme, selectedTool


    if event.key == pg.K_1:
        colorScheme = 1
    elif event.key == pg.K_2:
        colorScheme = 2

    if event.key == pg.K_e:
        selectedTool = 1
        B_Buttons[1].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_b:
        selectedTool = 0
        B_Buttons[0].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_g:
        selectedTool = 2
        B_Buttons[2].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False
    elif event.key == pg.K_i:
        selectedTool = 3
        B_Buttons[3].clicked = True
        for subbutton in B_Buttons:
            if B_Buttons.index(subbutton) != selectedTool:
                subbutton.clicked = False

    if event.key == pg.K_LCTRL:
        holdingCTRL = False

    if event.key == pg.K_SPACE:
        if holdingCTRL:
            g1.clean()
            undoed = True

    if event.key == pg.K_s:
        if holdingCTRL:
            shortcutPath = FileManager(1)
            SaveFile(g1, shortcutPath)

    if event.key == pg.K_z:
        if holdingCTRL:

            for i in range(g1.yCount):
                for j in range(g1.xCount):
                    if round == 1:
                        g1.change_color(j, i, g1.undoList[1][i][j])
                    if round == -1:
                        g1.change_color(j, i, g1.undoList[0][i][j])
            undoed = True 
开发者ID:Burakcoli,项目名称:Pyint_Pixel-Painter,代码行数:59,代码来源:pyint.py


注:本文中的pygame.K_i方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。