@Override
	public void update() {
		//If the button wasn't yet pressed
		if(!pressed){
			//Get mouse position
			Vector mousePos = Directory.inputManager.getMousePosition();
			//If the button contains the mouse
			if(attachedTo.contains(mousePos.getComponent(0), mousePos.getComponent(1))){
				//If the LMB is being pressed
				if(Directory.inputManager.isMouseButtonPressed(MouseEvent.BUTTON1)){
					action();
					pressed = true;
				}
				else{
					onHover();
				}

			}
		}
		//Else if the button was pressed
		else{
			//Wait until the mouse is released to set the button back to unpressed
			if(!Directory.inputManager.isMouseButtonPressed(MouseEvent.BUTTON1)){
				pressed = false;
			}
		}



	}