MCPcopy Create free account
hub / github.com/Card-Forge/forge / drawOverlay

Method drawOverlay

forge-gui-mobile/src/forge/toolbox/FDialog.java:212–248  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

210 }
211
212 @Override
213 public void drawOverlay(Graphics g) {
214 //draw swipe bar
215 float dx = SWIPE_BAR_HEIGHT * 0.7f;
216 float startX = dx * 0.7f;
217 float x = startX;
218 float y = getHeight() - (totalHeight + getBottomMargin()) * revealPercent - SWIPE_BAR_HEIGHT;
219 float w = getWidth();
220 float dotRadius = SWIPE_BAR_HEIGHT / 6;
221 float dotTop = y + SWIPE_BAR_HEIGHT / 2;
222 int dotCount = 3;
223 g.fillRect(getSwipeBarColor(), 0, y, w, SWIPE_BAR_HEIGHT);
224 for (int i = 0; i < dotCount; i++) {
225 g.fillCircle(getSwipeBarDotColor(), x, dotTop, dotRadius);
226 x += dx;
227 }
228 x = w - startX;
229 for (int i = 0; i < dotCount; i++) {
230 g.fillCircle(getBorderColor(), x, dotTop, dotRadius);
231 x -= dx;
232 }
233 g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
234
235 if (revealPercent == 0) { return; } //skip rest if hidden
236
237 y += SWIPE_BAR_HEIGHT;
238 g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
239
240 //draw border above prompt
241 y = prompt.getTop();
242 if (btnMiddle != null && !title.isEmpty()) { //render title above prompt if middle button present
243 y -= MSG_HEIGHT;
244 g.fillRect(VPrompt.getBackColor(), 0, y, w, MSG_HEIGHT);
245 g.drawText(title, VPrompt.FONT, VPrompt.getForeColor(), 0, y, w, MSG_HEIGHT, false, Align.center, true);
246 }
247 g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
248 }
249
250 @Override
251 public boolean fling(float velocityX, float velocityY) {

Callers 1

drawMethod · 0.45

Calls 14

getBottomMarginMethod · 0.95
getSwipeBarColorMethod · 0.95
getSwipeBarDotColorMethod · 0.95
getBorderColorMethod · 0.95
getBackColorMethod · 0.95
getForeColorMethod · 0.95
fillRectMethod · 0.80
fillCircleMethod · 0.80
drawLineMethod · 0.80
getHeightMethod · 0.65
getWidthMethod · 0.65
isEmptyMethod · 0.65

Tested by

no test coverage detected