Пример #1
0
        public Battlefield()
        {
            r = new Random();
            screen_size = Util.DetectScreenSize();
            Paint p = CustomUtil.GetColors [(int)CustomShapeColor.Green];
            player = new Player(screen_size.Width / 2, screen_size.Height / 2, sizeShape, p);
            CreateEnemies();

            background = Bitmap.CreateBitmap(screen_size.Width, screen_size.Height, Bitmap.Config.Argb8888);
            draw_canvas = new Canvas (background);
        }
Пример #2
0
        public Battlefield()
        {
            r           = new Random();
            screen_size = Util.DetectScreenSize();
            Paint p = CustomUtil.GetColors [(int)CustomShapeColor.Green];

            player = new Player(screen_size.Width / 2, screen_size.Height / 2, sizeShape, p);
            CreateEnemies();

            background  = Bitmap.CreateBitmap(screen_size.Width, screen_size.Height, Bitmap.Config.Argb8888);
            draw_canvas = new Canvas(background);
        }
Пример #3
0
 public static CustomSize DetectScreenSize()
 {
     if (cs == null)
     {
         DisplayMetrics metrics = displayMetrics;
         int            width   = ConvertPixelsToDp(metrics.WidthPixels);
         int            height  = ConvertPixelsToDp(metrics.HeightPixels);
         cs = new CustomSize(720, 1280);
         //cs = new CustomSize(width,height);
     }
     return(cs);
     //return new int[] { width, height };
 }
Пример #4
0
 public static CustomSize DetectScreenSize()
 {
     if (cs == null)
     {
         DisplayMetrics metrics = displayMetrics;
         int width = ConvertPixelsToDp(metrics.WidthPixels);
         int height = ConvertPixelsToDp(metrics.HeightPixels);
         cs = new CustomSize(720,1280);
         //cs = new CustomSize(width,height);
     }
     return cs;
     //return new int[] { width, height };
 }