screen.dart 447 B

12345678910111213141516
  1. import '../model/display.dart';
  2. import './device.dart';
  3. class Screen {
  4. /// 随着大小间距变化
  5. static double getBorderWidth(int gameType) {
  6. return Display.spacerUnit / gameType * Display.borderMargin;
  7. }
  8. static double getBlockWidth(int gameType) {
  9. return (Screen.stageWidth - getBorderWidth(gameType) * (gameType + 1)) /
  10. gameType;
  11. }
  12. static double get stageWidth => Device.getWidth() - Display.borderMargin * 2;
  13. }