Exemplo n.º 1
0
    def select(self):
        media.sui["click"].play()
        sb = module.scene_gui_behavior
        s = 1
        if self.fadeinref:
            s = self.fadeinref.x
            self.fadeinref.delete()

        if self.index == 0:
            if constant.GAME_DEBUG == False:
                sequencer.LinearInterpolation(s, 0, 2, MainMenu.xcolor,
                                              sb.startGame)
            else:
                MainMenu.xcolor(0)
                sb.startGame()
            self.xactive(False)

        if self.index == 1:
            if constant.GAME_DEBUG == False:
                sequencer.LinearInterpolation(s, 0, 2, MainMenu.xcolor,
                                              sb.startEditor)
            else:
                MainMenu.xcolor(0)
                sb.startEditor()
            self.xactive(False)

        #if self.index == 2:
        #	sequencer.LinearInterpolation(s, 0, 0.5, MainMenu.xcolor, logic.endGame)
        #	self.xactive(False)

        if self.index == 2:
            self.music.play()
Exemplo n.º 2
0
    def fadeOut(self, time):
        """Starts to make fadeout now. It actuates over the alpha chanel of the |KX_GameObject| representing this screen. In order to work it needs *object color* enabled on the material.
		
		:param float time: How long the fadein lasts.
		"""
        sequencer.LinearInterpolation(self.obj.color.w, 0, time,
                                      self._interpol)
Exemplo n.º 3
0
	def fadeOut(self, time, stop = False):
		"""Starts to make fadeout now.
		
		:param float time: How long the fadeout lasts.
		:param bool stop: If True it will automatically stop the reproduction at the end.
		"""
		if self.fadeout and self.fadeout.status != False:
			self.fadeout.delete()
		
		if self.fadein and self.fadein.status != False:
			self.fadein.delete()
			
		if stop:
			self.fadeout = sequencer.LinearInterpolation(self.volume, self.volume_min, time, self._interpol, self.stop)
		else:
			self.fadeout = sequencer.LinearInterpolation(self.volume, self.volume_min, time, self._interpol)
Exemplo n.º 4
0
 def setupMainMenu(self):
     MainMenu(0, "MItem.000", "Start")
     MainMenu(1, "MItem.001", "Editor")
     #MainMenu(2, "MItem.002", "Exit")
     MainMenu(2, "MItem.002", "Play music")
     if constant.GAME_DEBUG == True:
         MainMenu.xcolor(1)
     else:
         MainMenu.fadeinref = sequencer.LinearInterpolation(
             0, 1, 2, MainMenu.xcolor)
Exemplo n.º 5
0
	def fadeIn(self, time):
		"""Starts to make fadein now.
		
		:param float time: How long the fadein lasts.
		"""
		if self.fadein and self.fadein.status != False:
			self.fadein.delete()
		
		if self.fadeout and self.fadeout.status != False:
			self.fadeout.delete()
			
		self.fadein = sequencer.LinearInterpolation(self.volume, self.volume_max, time, self._interpol)
Exemplo n.º 6
0
    def onKeyDown(self, keys):
        def setDBS(self, val):
            self.dbs = val

        if event.selected == None and key.RIGHTMOUSE in keys:
            if self.twt.status == True:
                self.twt.finish()
                if self.bubble != None: self.bubble.visible = True
            else:
                if not self.dbs and self.visible:
                    self.dbs = sequencer.LinearInterpolation(
                        1, 0, 2, self.set_alpha, lambda: setDBS(self, None))

        if event.selected == None and key.LEFTMOUSE in keys:
            if self.twt.status == True:
                self.twt.finish()
                if self.bubble != None: self.bubble.visible = True
            elif self.visible == False:
                if self.dbs: self.dbs.delete()
                self.dbs = sequencer.LinearInterpolation(
                    0, 1, 2, self.set_alpha, lambda: setDBS(self, None))
            elif self.dbs == None:
                if self.bubble != None: self.bubble.visible = False

                name, text = self.parser.next()
                color = None

                if type(name) == Character:
                    ch = name
                    name = name.name
                    color = ch.color

                self.twt.text = text
                if self.name:
                    self.name.text = name
                    if color: self.name.color = color
Exemplo n.º 7
0
	def secTitle(self):
		t = 8
		m = 6
		sequencer.AlphaFade(self.title, 0, 1, t, t, m)
		sequencer.LinearInterpolation(0.875, 1.2, t+t+m, self.setTitleScale, transform=True)
Exemplo n.º 8
0
	def startTitle(self):
		sequencer.LinearInterpolation(1, 0, 8, self.backgroundcolor)
		self.secTitle()