本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}