public Scores(int Width, int Height) { CanvasWidth = Width; CanvasHeight = Height; #region SetShareForm ShareForm = new CompressionImage("data/ShareButton.png", 125, 70); #endregion #region SetVKshareButton ShareVK = new Button("data/ShareVK.png", 30, 30); ShareVK.x = 50; ShareVK.y = Height - 30 - 40; #endregion #region SetFACEBOOKsharebutton ShareFaceBook = new Button("data/ShareFACEBOOK.png", 30, 30); ShareFaceBook.x = 50 + 60 + 3; ShareFaceBook.y = Height - 30 - 40; #endregion #region SetContinueButton Continue = new Button("data/StartNewGameButt.png", 150, 30); Continue.x = 50 + 30 + 3 + 30 + 3 + 50; Continue.y = Height - 30 - 40; #endregion #region SetBackButton Back = new Button("data/back.png", 150, 30); Back.x = (Width - 150) / 2; Back.y = Height - 30 - 50; #endregion #region SetEdit editX = (Width - editWidth) / 2; editY = (Height - editHeight) / 2; #endregion BackGround = Image.FromFile("data/Achievements/BackGround.png"); ListBackground = new CompressionImage("data/Sprites/ListBackGround.png", Width, Height); active = ScoreState.Null; Event_timer.Start(); }
public Button(string s, int w, int h) { width = w; height = h; img = new CompressionImage(s, width, height); }
public Button(Image create, int w, int h) { width = w; height = h; img = new CompressionImage(create, width, height); }
public View(int width, int height) { Bitmap = new System.Drawing.Bitmap(width, height); Graphics = System.Drawing.Graphics.FromImage(Bitmap); Width = width; Height = height; length = Height * 8 / 12; ConsoleList = new List <string>(); BanerTimer = new Stopwatch(); StarTimer = new Stopwatch(); StarTimer.Start(); StarX = new List <int>(); StarY = new List <int>(); StarTime = new List <int>(); //Coorinate Stars for (int i = 0; i < 200; ++i) { StarX.Add(Utily.Next() % Width); StarY.Add(Utily.Next() % Height); StarTime.Add(Utily.Next() % 200 + 100); } ArrowTimerAnimation = new Stopwatch(); normallength = length; #region setted images room[0] = new CompressionImage("data/Cave/TryTop1.png", length / 3, length / 3); room[1] = new CompressionImage("data/Cave/TryUpperLeft1.png", length / 3, length / 3); room[2] = new CompressionImage("data/Cave/TryBottomLeft1.png", length / 3, length / 3); room[3] = new CompressionImage("data/Cave/TryTop1.png", length / 3, length / 3); room[4] = new CompressionImage("data/Cave/TryUpperLeft1.png", length / 3, length / 3); room[5] = new CompressionImage("data/Cave/TryBottomLeft1.png", length / 3, length / 3); for (int i = 0; i < 6; ++i) { room[i].ScreenWidth = width; room[i].ScreenHeight = height; } CaveRoom = new CompressionImage[CountImageRoom]; for (int i = 0; i < CountImageRoom; ++i) { CaveRoom[i] = new CompressionImage("data/Cave/ColorRoom" + (i + 1) + ".png", length, length, Width, Height); } PitRoom = new CompressionImage("data/Cave/PitRoom.png", length, length, Width, Height); TypeImageRoom = new int[30]; UpdateImage(); DarkRoom = new CompressionImage("data/Cave/DarkRoom.png", length, length, Width, Height); BackGround = new CompressionImage("data/Cave/background.png", width, 120); WumpusImg = new CompressionImage("data/Cave/wumpus.png", length / 2, length / 2, Width, Height); DiffImg = new CompressionImage[3]; DiffImg[1] = new CompressionImage("./data/Sprites/Bow.png", 200, 200, Width, Height); DiffImg[2] = new CompressionImage("./data/Sprites/CrossBow.png", 200, 200, Width, Height); DiffImg[0] = new CompressionImage("./data/Sprites/Spear.png", 200, 200, Width, Height); #endregion #region setted constants // const for drawing bridge StownPosX.Add(1.0f / 3.0f - 1.0f / 70.0f); // 0 item StownPosY.Add(-1.0f / 6.0f); StownPosX.Add(0); // 1 item StownPosY.Add(1.0f / 9.0f); StownPosX.Add(0); // 2 item StownPosY.Add(1.0f / 9.0f + 1.0f / 2.0f); StownPosX.Add(StownPosX[0]); // 3 item StownPosY.Add(StownPosY[0] + 1); StownPosX.Add(StownPosX[1] + 2.0f / 3.0f); // 4 item StownPosY.Add(StownPosY[1] + 1.0f / 2.0f); StownPosX.Add(StownPosX[2] + 2.0f / 3.0f); // 5 item StownPosY.Add(StownPosY[2] - 1.0f / 2.0f); // for animation ScaleRoomX.Add(0); // 0 item ScaleRoomY.Add(-1); ScaleRoomX.Add(-0.67f); // 1 item ScaleRoomY.Add(-0.5f); ScaleRoomX.Add(-0.67f); // 2 item ScaleRoomY.Add(0.5f); ScaleRoomX.Add(0); // 3 item ScaleRoomY.Add(1); ScaleRoomX.Add(0.67f); // 4 item ScaleRoomY.Add(0.5f); ScaleRoomX.Add(0.67f); // 5 item ScaleRoomY.Add(-0.5f); #endregion MainMenuImage = Image.FromFile(@".\data\Sprites\Menu.png"); MainForm = new Form1(Drawing, width, height); MainForm.Show(); deltaY = height / 36 + 30; }