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


Python Scene.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Scene import Scene [as 别名]
# 或者: from Scene.Scene import __init__ [as 别名]
 def __init__(self, director, pausedScene, title='Warning!', message='Message', tooltip='Press here to continue'):
     Scene.__init__(self, director)
     self.bluredBackground = None
     self.b = 1
     self.pausedScene = pausedScene
     layer = Layer(director)
     backgroundImage = Resources.load_image("message_box.png")
     buttonImage = Resources.load_image("message_box_button.png")
     buttonWidth = 372
     style = MessageBox.createMessageBoxStyle(
         backgroundImage, buttonImage, buttonWidth)
     self.messageBox = MessageBox.MessageBox(
         self.director, (SCREEN_W / 2 - style['bg'].get_width() / 2, SCREEN_H / 2 - style['bg'].get_height() / 2), style, True)
     self.messageBox.button.onMouseDown = lambda: self.popScene()
     self.messageBox.title = title
     self.messageBox.message = message
     self.messageBox.tooltip = tooltip
     layer.append(self.messageBox)
     self.layers.append(layer)
开发者ID:dgalaktionov,项目名称:Aleph,代码行数:21,代码来源:MessageScene.py

示例2: __init__

# 需要导入模块: from Scene import Scene [as 别名]
# 或者: from Scene.Scene import __init__ [as 别名]
    def __init__(self, director, player):
        Scene.__init__(self, director)
        self.player = player
        self.enemyGroup = EntityGroup([])
        self.bulletGroup = EntityGroup([])
        self.groups = []
        self.groups.append(self.enemyGroup)
        self.groups.append(self.bulletGroup)

        self.bg = None
        self.collisionBg = None
        self.camera = Camera()

        self.HUD = HUD(self.director, (0, 467), True, player)
        hudLayer = Layer(self.director)
        hudLayer.append(self.HUD)
        self.layers.append(hudLayer)
        self.mouseHoveringHUD = False
        
        self.danger = False
        self.dangerLevel = 0
        
        self.gameOver = False
开发者ID:dgalaktionov,项目名称:Aleph,代码行数:25,代码来源:Level.py

示例3: __init__

# 需要导入模块: from Scene import Scene [as 别名]
# 或者: from Scene.Scene import __init__ [as 别名]
    def __init__(self):
        Scene.__init__(self)

        self.sprite = Sprite("test1.png")
        self.sprite.position = 100, 100
开发者ID:choiseungil29,项目名称:CLogic,代码行数:7,代码来源:TestScene.py

示例4: __init__

# 需要导入模块: from Scene import Scene [as 别名]
# 或者: from Scene.Scene import __init__ [as 别名]
    def __init__(self, engine, libraryName=None, songName=None):
        Scene.__init__(self, engine)

        if self.engine.world.sceneName == "SongChoosingScene":  # MFH - dual / triple loading cycle fix
            Log.warn("Extra SongChoosingScene was instantiated, but detected and shut down.  Cause unknown.")
            raise SuppressScene  # stump
        else:
            self.engine.world.sceneName = "SongChoosingScene"

        if self.engine.config.get("debug", "use_new_song_database"):
            Song.updateSongDatabase(self.engine)

        self.wizardStarted = False
        self.libraryName = libraryName
        self.songName = songName
        if not self.libraryName:
            self.libraryName = self.engine.config.get("setlist", "selected_library")
            if not self.libraryName:
                self.libraryName = Song.DEFAULT_LIBRARY
        if not self.songName:
            self.songName = self.engine.config.get("setlist", "selected_song")
        self.gameMode = self.engine.world.gameMode
        self.careerMode = self.gameMode == CAREER
        self.practiceMode = self.gameMode == PRACTICE
        self.gameMode2p = self.engine.world.multiMode
        self.autoPreview = not self.engine.config.get("audio", "disable_preview")
        self.sortOrder = self.engine.config.get("game", "sort_order")
        self.tut = self.engine.world.tutorial
        self.playerList = self.players

        self.gameStarted = False

        self.gamePlayers = len(self.playerList)
        self.parts = [None for i in self.playerList]
        self.diffs = [None for i in self.playerList]

        self.time = 0
        self.lastTime = 0
        self.mode = 0
        self.moreInfo = False
        self.moreInfoTime = 0
        self.miniLobbyTime = 0
        self.selected = 0
        self.camera = Camera()
        self.cameraOffset = 0.0
        self.song = None
        self.songLoader = None
        self.loaded = False
        text = _("Initializing Setlist...")
        if self.engine.cmdPlay == 2:
            text = _("Checking Command-Line Settings...")
        elif len(self.engine.world.songQueue) > 0:
            text = _("Checking Setlist Settings...")
        elif len(self.engine.world.songQueue) == 0:
            self.engine.world.playingQueue = False
        self.splash = Dialogs.showLoadingSplashScreen(self.engine, text)
        self.items = []
        self.cmdPlay = False
        self.queued = True

        self.loadStartTime = time.time()

        if self.tut == True:
            self.library = self.engine.tutorialFolder
        else:
            self.library = os.path.join(self.engine.config.get("setlist", "base_library"), self.libraryName)
            if not os.path.isdir(self.engine.resource.fileName(self.library)):
                self.library = self.engine.resource.fileName(
                    os.path.join(self.engine.config.get("setlist", "base_library"), Song.DEFAULT_LIBRARY)
                )

        self.searchText = ""

        # user configurables and input management
        self.listingMode = 0  # with libraries or List All
        self.preloadSongLabels = False
        self.showCareerTiers = 1 + (self.careerMode and 1 or 0)  # 0-Never; 1-Career Only; 2-Always
        self.scrolling = 0
        self.scrollDelay = self.engine.config.get("game", "scroll_delay")
        self.scrollRate = self.engine.config.get("game", "scroll_rate")
        self.scrollTime = 0
        self.scroller = [lambda: None, self.scrollUp, self.scrollDown]
        self.scoreDifficulty = Song.difficulties[self.engine.config.get("game", "songlist_difficulty")]
        self.scorePart = Song.parts[self.engine.config.get("game", "songlist_instrument")]
        self.sortOrder = self.engine.config.get("game", "sort_order")
        self.queueFormat = self.engine.config.get("game", "queue_format")
        self.queueOrder = self.engine.config.get("game", "queue_order")
        self.queueParts = self.engine.config.get("game", "queue_parts")
        self.queueDiffs = self.engine.config.get("game", "queue_diff")
        self.nilShowNextScore = self.engine.config.get("songlist", "nil_show_next_score")

        # theme information
        self.themename = self.engine.data.themeLabel
        self.theme = self.engine.data.theme

        # theme configurables
        self.setlistStyle = self.engine.theme.setlist.setlistStyle  # 0 = Normal; 1 = List; 2 = Circular
        self.headerSkip = self.engine.theme.setlist.headerSkip  # items taken up by header (non-static only)
        self.footerSkip = self.engine.theme.setlist.footerSkip  # items taken up by footer (non-static only)
        self.itemSize = self.engine.theme.setlist.itemSize  # delta (X, Y) (0..1) for each item (non-static only)
#.........这里部分代码省略.........
开发者ID:paulhayes,项目名称:fofix,代码行数:103,代码来源:SongChoosingScene.py

示例5: __init__

# 需要导入模块: from Scene import Scene [as 别名]
# 或者: from Scene.Scene import __init__ [as 别名]
 def __init__(self, id = None, manager = None):
   Scene.__init__(self, id, manager)
开发者ID:HugoLnx,项目名称:fofix,代码行数:4,代码来源:SceneTest.py


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