public int getInventorySlot(int x,int y){
		int totalSlots =  player.getInventorySize();

		//needed so that it draws in the right position. Placeholder.
		int offsetY = 285;
		int offsetX = 52;


		for(int i = 0; i<totalSlots;i++){

			//if the mouse is in the x bounds of one of the inventory slots
			if(x > inventoryBarPos.x + (i*inventorySlotSize) + offsetX && x< inventoryBarPos.x + ((i+1)*inventorySlotSize)+ offsetX){

				//if the mouse is in the y bounds of the inventory slots
				if(y> inventoryBarPos.y + offsetY && y<inventoryBarPos.y +inventorySlotSize + offsetY){

					//return this inventory slot
					return i;
				}
			}
		}

		//if nothing is found return -1 indicating no slot here
		return -1;
	}