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

Class MenuIcon

forge-gui-mobile/src/forge/screens/FScreen.java:352–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350 }
351
352 protected static class MenuIcon implements FImage {
353 private static FSkinColor getColor() {
354 if (Forge.isMobileAdventureMode)
355 return FSkinColor.get(Colors.ADV_CLR_TEXT);
356 return FSkinColor.get(Colors.CLR_TEXT);
357 }
358
359 private final float width, height;
360 public MenuIcon(float width0, float height0) {
361 width = width0;
362 height = height0;
363 }
364
365 @Override
366 public float getWidth() {
367 return width;
368 }
369
370 @Override
371 public float getHeight() {
372 return height;
373 }
374
375 @Override
376 public void draw(Graphics g, float x, float y, float w, float h) {
377 float thickness = Math.round(h / 5);
378 float delta = Math.round(thickness * 1.75f);
379 y += (h - 2 * delta - thickness) / 2;
380
381 g.fillRect(getColor(), x, y, thickness, thickness);
382 y += delta;
383 g.fillRect(getColor(), x, y, thickness, thickness);
384 y += delta;
385 g.fillRect(getColor(), x, y, thickness, thickness);
386 x += delta;
387 y -= 2 * delta;
388 w -= delta;
389 g.fillRect(getColor(), x, y, w, thickness);
390 y += delta;
391 g.fillRect(getColor(), x, y, w, thickness);
392 y += delta;
393 g.fillRect(getColor(), x, y, w, thickness);
394 }
395 }
396
397 protected boolean allowBackInLandscapeMode() {
398 return getLandscapeBackdropScreen() != HomeScreen.instance; //don't allow going back if home screen is backdrop by default

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected