當前位置: 首頁>>代碼示例>>Java>>正文


Java UI.updateTooltip方法代碼示例

本文整理匯總了Java中itdelatrisu.opsu.ui.UI.updateTooltip方法的典型用法代碼示例。如果您正苦於以下問題:Java UI.updateTooltip方法的具體用法?Java UI.updateTooltip怎麽用?Java UI.updateTooltip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在itdelatrisu.opsu.ui.UI的用法示例。


在下文中一共展示了UI.updateTooltip方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preRenderUpdate

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
@Override
public void preRenderUpdate() {
	super.preRenderUpdate();
	GameMod hoverMod = null;
	for (GameMod mod : GameMod.values()) {
		mod.hoverUpdate(displayContainer.renderDelta, mod.isActive());
		if (hoverMod == null && mod.contains(displayContainer.mouseX, displayContainer.mouseY))
			hoverMod = mod;
	}

	// tooltips
	if (hoverMod != null) {
		UI.updateTooltip(displayContainer.renderDelta, hoverMod.getDescription(), true);
	}
}
 
開發者ID:yugecin,項目名稱:opsu-dance,代碼行數:16,代碼來源:ButtonMenu.java

示例2: updateRankingDisplays

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
/**
 * Updates displayed ranking elements based on a delta value.
 * @param delta the delta interval since the last call
 * @param mouseX the mouse x coordinate
 * @param mouseY the mouse y coordinate
 */
public void updateRankingDisplays(int delta, int mouseX, int mouseY) {
	// graph tooltip
	Image graphImg = GameImage.RANKING_GRAPH.getImage();
	float graphX = 416 * GameImage.getUIscale();
	float graphY = 688 * GameImage.getUIscale();
	if (isGameplay &&
	    mouseX >= graphX - graphImg.getWidth() / 2f && mouseX <= graphX + graphImg.getWidth() / 2f &&
	    mouseY >= graphY - graphImg.getHeight() / 2f && mouseY <= graphY + graphImg.getHeight() / 2f) {
		if (performanceString == null)
			performanceString = getPerformanceString(hitErrors);
		UI.updateTooltip(delta, performanceString, true);
	}
}
 
開發者ID:itdelatrisu,項目名稱:opsu,代碼行數:20,代碼來源:GameData.java

示例3: update

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
@Override
public void update(GameContainer container, int delta, int mouseX, int mouseY) {
	super.update(container, delta, mouseX, mouseY);
	GameMod hoverMod = null;
	for (GameMod mod : GameMod.values()) {
		mod.hoverUpdate(delta, mod.isActive());
		if (hoverMod == null && mod.contains(mouseX, mouseY))
			hoverMod = mod;
	}

	// tooltips
	if (hoverMod != null)
		UI.updateTooltip(delta, hoverMod.getDescription(), true);
}
 
開發者ID:itdelatrisu,項目名稱:opsu,代碼行數:15,代碼來源:ButtonMenu.java

示例4: preRenderUpdate

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
@Override
public void preRenderUpdate() {
	super.preRenderUpdate();

	int delta = displayContainer.renderDelta;
	UI.update(delta);
	if (importThread == null)
		MusicController.loopTrackIfEnded(false);
	else if (importThread.isFinished()) {
		BeatmapSetNode importedNode = importThread.getImportedBeatmap();
		if (importedNode != null) {
			// stop preview
			previewID = -1;
			SoundController.stopTrack();

			// initialize song list
			BeatmapSetList.get().reset();
			BeatmapSetList.get().init();

			// focus new beatmap
			// NOTE: This can't be called in another thread because it makes OpenGL calls.
			songMenuState.setFocus(importedNode, -1, true, true);
		}
		importThread = null;
	}
	int mouseX = displayContainer.mouseX;
	int mouseY = displayContainer.mouseY;
	UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
	prevPage.hoverUpdate(delta, mouseX, mouseY);
	nextPage.hoverUpdate(delta, mouseX, mouseY);
	clearButton.hoverUpdate(delta, mouseX, mouseY);
	importButton.hoverUpdate(delta, mouseX, mouseY);
	resetButton.hoverUpdate(delta, mouseX, mouseY);
	rankedButton.hoverUpdate(delta, mouseX, mouseY);

	if (DownloadList.get() != null)
		startDownloadIndexPos.setMinMax(0, DownloadNode.getInfoHeight() * (DownloadList.get().size() -  DownloadNode.maxDownloadsShown()));
	startDownloadIndexPos.update(delta);
	if (resultList != null)
		startResultPos.setMinMax(0, DownloadNode.getButtonOffset() * (resultList.length - DownloadNode.maxResultsShown()));
	startResultPos.update(delta);

	// focus timer
	if (focusResult != -1 && focusTimer < FOCUS_DELAY)
		focusTimer += delta;

	// search
	searchTimer += delta;
	if (searchTimer >= SEARCH_DELAY && importThread == null) {
		searchTimer = 0;
		searchTimerReset = false;

		String query = search.getText().trim().toLowerCase();
		DownloadServer server = serverMenu.getSelectedItem();
		if ((lastQuery == null || !query.equals(lastQuery)) &&
		    (query.length() == 0 || query.length() >= server.minQueryLength())) {
			lastQuery = query;
			lastQueryDir = pageDir;

			if (queryThread != null && queryThread.isAlive()) {
				queryThread.interrupt();
				if (searchQuery != null)
					searchQuery.interrupt();
			}

			// execute query
			searchQuery = new SearchQuery(query, server);
			queryThread = new Thread(searchQuery);
			queryThread.start();
		}
	}

	// tooltips
	if (resetButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Reset the current search.", false);
	else if (rankedButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Toggle the display of unranked maps.\nSome download servers may not support this option.", true);
	else if (serverMenu.baseContains(mouseX, mouseY))
		UI.updateTooltip(delta, "Select a download server.", false);
}
 
開發者ID:yugecin,項目名稱:opsu-dance,代碼行數:81,代碼來源:DownloadsMenu.java

示例5: update

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
/**
 * Updates the overlay.
 * @param delta the delta interval since the last call
 */
public void update(int delta) {
	if (!active)
		return;

	// check if mouse moved
	int mouseX = input.getMouseX(), mouseY = input.getMouseY();
	boolean mouseMoved;
	if (mouseX == prevMouseX && mouseY == prevMouseY)
		mouseMoved = false;
	else {
		mouseMoved = true;
		prevMouseX = mouseX;
		prevMouseY = mouseY;
	}

	// delta updates
	if (hoverOption != null && getOptionAtPosition(mouseX, mouseY) == hoverOption && !keyEntryLeft && !keyEntryRight)
		UI.updateTooltip(delta, hoverOption.getDescription(), true);
	else if (showRestartButton && restartButton.contains(mouseX, mouseY) && !keyEntryLeft && !keyEntryRight)
		UI.updateTooltip(delta, "Click to restart the game.", false);
	backButton.hoverUpdate(delta, backButton.contains(mouseX, mouseY) && !keyEntryLeft && !keyEntryRight);
	if (showRestartButton)
		restartButton.autoHoverUpdate(delta, false);
	sliderSoundDelay = Math.max(sliderSoundDelay - delta, 0);
	updateIndicatorAlpha(delta);
	int previousScrollingPosition = (int) scrolling.getPosition();
	scrolling.update(delta);
	boolean scrollingMoved = (int) scrolling.getPosition() != previousScrollingPosition;
	invalidSearchAnimation.update(delta);

	if (mouseMoved || scrollingMoved)
		updateHoverOption(mouseX, mouseY);

	if (mouseX < navWidth) {
		if (navHoverTime < 600)
			navHoverTime += delta;
	} else if (navHoverTime > 0)
		navHoverTime -= delta;
	navHoverTime = Utils.clamp(navHoverTime, 0, 600);
	updateActiveSection();
	updateNavigationHover(mouseX, mouseY);

	// selected option indicator position
	indicatorRenderPos = indicatorPos;
	if (indicatorMoveAnimationTime > 0) {
		indicatorMoveAnimationTime += delta;
		if (indicatorMoveAnimationTime > INDICATOR_MOVE_ANIMATION_TIME) {
			indicatorMoveAnimationTime = 0;
			indicatorRenderPos += indicatorOffsetToNextPos;
			indicatorOffsetToNextPos = 0;
			indicatorPos = indicatorRenderPos;
		} else {
			float progress = (float) indicatorMoveAnimationTime / INDICATOR_MOVE_ANIMATION_TIME;
			indicatorRenderPos += AnimationEquation.OUT_BACK.calc(progress) * indicatorOffsetToNextPos;
		}
	}

	if (!mouseMoved)
		return;

	// update slider option
	if (isAdjustingSlider)
		adjustSlider(mouseX, mouseY);
}
 
開發者ID:itdelatrisu,項目名稱:opsu,代碼行數:69,代碼來源:OptionsOverlay.java

示例6: update

import itdelatrisu.opsu.ui.UI; //導入方法依賴的package包/類
@Override
public void update(GameContainer container, StateBasedGame game, int delta)
		throws SlickException {
	UI.update(delta);
	if (importThread == null)
		MusicController.loopTrackIfEnded(false);
	else if (importThread.isFinished()) {
		BeatmapSetNode importedNode = importThread.getImportedBeatmap();
		if (importedNode != null) {
			// stop preview
			previewID = -1;
			SoundController.stopTrack();

			// initialize song list
			BeatmapSetList.get().reset();
			BeatmapSetList.get().init();

			// focus new beatmap
			// NOTE: This can't be called in another thread because it makes OpenGL calls.
			((SongMenu) game.getState(Opsu.STATE_SONGMENU)).setFocus(importedNode, -1, true, true);
		}
		importThread = null;
	}
	int mouseX = input.getMouseX(), mouseY = input.getMouseY();
	UI.getBackButton().hoverUpdate(delta, mouseX, mouseY);
	prevPage.hoverUpdate(delta, mouseX, mouseY);
	nextPage.hoverUpdate(delta, mouseX, mouseY);
	clearButton.hoverUpdate(delta, mouseX, mouseY);
	importButton.hoverUpdate(delta, mouseX, mouseY);
	resetButton.hoverUpdate(delta, mouseX, mouseY);
	rankedButton.hoverUpdate(delta, mouseX, mouseY);

	if (DownloadList.get() != null)
		startDownloadIndexPos.setMinMax(0, DownloadNode.getInfoHeight() * (DownloadList.get().size() -  DownloadNode.maxDownloadsShown()));
	startDownloadIndexPos.update(delta);
	if (resultList != null)
		startResultPos.setMinMax(0, DownloadNode.getButtonOffset() * (resultList.length - DownloadNode.maxResultsShown()));
	startResultPos.update(delta);

	// focus timer
	if (focusResult != -1 && focusTimer < FOCUS_DELAY)
		focusTimer += delta;

	// search
	search.setFocus(true);
	searchTimer += delta;
	if (searchTimer >= SEARCH_DELAY && importThread == null) {
		searchTimer = 0;
		searchTimerReset = false;

		String query = search.getText().trim().toLowerCase();
		DownloadServer server = serverMenu.getSelectedItem();
		if ((lastQuery == null || !query.equals(lastQuery)) &&
		    (query.length() == 0 || query.length() >= server.minQueryLength())) {
			lastQuery = query;
			lastQueryDir = pageDir;

			if (queryThread != null && queryThread.isAlive()) {
				queryThread.interrupt();
				if (searchQuery != null)
					searchQuery.interrupt();
			}

			// execute query
			searchQuery = new SearchQuery(query, server);
			queryThread = new Thread(searchQuery);
			queryThread.start();
		}
	}

	// tooltips
	if (resetButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Reset the current search.", false);
	else if (rankedButton.contains(mouseX, mouseY))
		UI.updateTooltip(delta, "Toggle the display of unranked maps.\nSome download servers may not support this option.", true);
	else if (serverMenu.baseContains(mouseX, mouseY))
		UI.updateTooltip(delta, "Select a download server.", false);
}
 
開發者ID:itdelatrisu,項目名稱:opsu,代碼行數:79,代碼來源:DownloadsMenu.java


注:本文中的itdelatrisu.opsu.ui.UI.updateTooltip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。