예제 #1
0
	def update(self):
		mouse = MouseManager.mousePosRelative
		if self.pos[0] - self.size[0] / 2 < mouse[0]  < self.pos[0] + self.size[0] / 2:
			if self.pos[1] - self.size[1] / 2 < mouse[1] < self.pos[1] + self.size[1] / 2:
				self.isHover()
				if MouseManager.buttonPressed(0):
					self.func()
			else:
				self.isUnhover()
		else:
			self.isUnhover()
 def dispose():
     kbm.dispose()
     mm.dispose()
 def inputPressed(inpt):
     if InputManager.type[inpt] == 0:
         return kbm.keyPressed(InputManager.inputs[inpt])
     else:
         return mm.buttonPressed(InputManager.inputs[inpt])
 def inputReleased(inpt):
     if InputManager.type[inpt] == 0:
         return kbm.keyReleased(InputManager.inputs[inpt])
     else:
         return mm.buttonReleased(InputManager.inputs[inpt])
 def input(inpt):
     if InputManager.type[inpt] == 0:
         return kbm.getKey(InputManager.inputs[inpt])
     else:
         return mm.getButton(InputManager.inputs[inpt])