/// <summary> /// /// </summary> public LayoutForm(XmlNode node) { InitializeComponent(); SelectionBox = new SelectionTool(); CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png")); // CurrentLayout = new Layout(); CurrentLayout.Load(node); GuiPropertyBox.SelectedObject = CurrentLayout; //TabText = CurrentLayout.Name; // Gather all elements RebuildElementsBox(); // DrawTimer.Start(); }
//Point last = new Point(); private void DrawForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { UpdateTimer.Start(); DrawTimer.Start(); lasttime = DateTime.Now; } if (e.KeyCode == Keys.C) { UpdateTimer.Stop(); DrawTimer.Stop(); } if (e.KeyCode == Keys.D) { //camera.View = camera.View * Matrix4.Translate(0f, coeff, 0f); rocket.Move(new Vector3(rocket.Position.X + 10 * coeff, rocket.Position.Y, rocket.Position.Z)); } if (e.KeyCode == Keys.A) { rocket.Move(new Vector3(rocket.Position.X - 10 * coeff, rocket.Position.Y, rocket.Position.Z)); //camera.View = camera.View * Matrix4.Translate(0f, -coeff, 0f); } if (e.KeyCode == Keys.W) { rocket.Move(new Vector3(rocket.Position.X, rocket.Position.Y - 10 * coeff, rocket.Position.Z)); //camera.View = camera.View * Matrix4.Translate(0f, 0f, coeff); } if (e.KeyCode == Keys.S) { rocket.Move(new Vector3(rocket.Position.X, rocket.Position.Y + 10 * coeff, rocket.Position.Z)); //camera.View = camera.View * Matrix4.Translate(0f, 0f, -coeff); } }
// Выбор материала для рисования карты #region private void buttonGrass_Click(object sender, EventArgs e) { nowMaterial = new Grass(); drawMap = true; DrawTimer.Enabled = true; DrawTimer.Start(); }
private void Form1_KeyUp(object sender, KeyEventArgs e) {//при нажатии на пробел запускаем игру и придаем игроку ускорение в верх if (e.KeyCode == Keys.Space) { if (isGlowingOn) { pen.Width = 10; } DrawTimer.Start(); playerVelocity -= 20; DrawTimer.Start(); PlayerTimer.Start(); TubesTimer.Start(); } else if (e.KeyCode == Keys.Escape) { TubesTimer.Enabled = !TubesTimer.Enabled; PlayerTimer.Enabled = !DrawTimer.Enabled; DrawTimer.Enabled = !DrawTimer.Enabled; TubesTimer.Stop(); DrawTimer.Enabled = !DrawTimer.Enabled; button5.Visible = true; button5.Enabled = true; } else if (e.KeyCode == Keys.L) { DrawTimer.Stop(); new LiderboardForm2(score).Show(); } }
/// <summary> /// Draw Timer tick /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DrawTimer_Tick(object sender, EventArgs e) { // If not floating panel and the panel is active and AutoRefresh is OK if (this.DockAreas != DockAreas.Float && DockPanel.ActiveDocument == this) { int elapsed = Environment.TickCount - Time; Time = Environment.TickCount; // Stop the drawtimer DrawTimer.Stop(); //Animation.Update(TimeSpan.FromMilliseconds(elapsed)); Animation.Update(new GameTime(TimeSpan.Zero, TimeSpan.Zero, TimeSpan.Zero, TimeSpan.FromMilliseconds(elapsed))); GlFramesControl.Invalidate(); GlTilesControl.Invalidate(); GlPreviewControl.Invalidate(); // Restart the draw timer DrawTimer.Start(); } }
private void Form1_KeyUp(object sender, KeyEventArgs e) { // При нажатии на пробел запускаем игру и // придаем игроку ускорение вверх if (e.KeyCode == Keys.Space) { pen.Width = 10; playerVelocity -= 20; DrawTimer.Start(); TubeTimer.Start(); PlayerTimer.Start(); } else if (e.KeyCode == Keys.Escape) { DrawTimer.Enabled = !DrawTimer.Enabled; PlayerTimer.Enabled = !DrawTimer.Enabled; TubeTimer.Enabled = !DrawTimer.Enabled; button1.Visible = !true; button1.Enabled = !true; button2.Visible = !true; button2.Enabled = !true; button3.Visible = !true; button3.Enabled = !true; button4.Visible = !true; button4.Enabled = !true; } else if (e.KeyCode == Keys.L) { DrawTimer.Stop(); new LeaderBoardForm(score).Show(); } }
public window() { InitializeComponent(); DrawTimer.Start(); DrawGrid(); ChangesMade = false; }
/// <summary> /// Draw timer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DrawTimer_Tick(object sender, EventArgs e) { DrawTimer.Stop(); GlControl_Paint(null, null); DrawTimer.Start(); }
public void CreateZoomLens(Point FixationPoint) { Size zoomSize = new Size(this.Size.Width / 2, this.Size.Height / 2); this.Show();//make lens visible offScreenGraphics.DrawImage(zoomedScreenshot, 0, 0, zoomedScreenshot.Width, zoomedScreenshot.Height); this.TopMost = true; Console.WriteLine("ZoomLens.Bounds.X = " + this.Bounds.X); Console.WriteLine("ZoomLens.Bounds.Y = " + this.Bounds.Y); DrawTimer.Start(); Application.DoEvents(); }
public MainForm() { InitializeComponent(); mainConnector = new FormConnector(this); M_Form = this; this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); Game game = Game.Instance; game.adjustGameFormSize(this); DrawTimer.Start(); }
//*/ public MainForm() { InitializeComponent(); LangLoad(); LangApply(); ResourceLoad(); DataLoad(); Text = ProductName + " " + ProductVersion; mainToolStripMenuItem.Text = ProductName; versionToolStripMenuItem.Text = "Version: " + ProductVersion; Game_Reset(); DrawTimer.Start(); }
private void PlayBTN_Click(object sender, EventArgs e) { if (DrawTimer.Enabled) { DrawTimer.Stop(); PlayBTN.Text = "Play"; } else { DrawTimer.Interval = 500; DrawTimer.Start(); PlayBTN.Text = "Pause"; } }
/// <summary> /// Draw timer /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DrawTimer_Tick(object sender, EventArgs e) { DrawTimer.Stop(); GlControl_Paint(null, null); if (GlPreviewControl.Created) { GlPreviewControl_Paint(null, null); } DrawTimer.Start(); }
private void button1_Click(object sender, EventArgs e) { DrawTimer.Start(); PlayerTimer.Start(); TubeTimer.Start(); button1.Visible = false; button1.Enabled = false; button2.Visible = false; button2.Enabled = false; button3.Visible = false; button3.Enabled = false; button4.Visible = false; button4.Enabled = false; }
/// <summary> /// On form loading /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DungeonForm_Load(object sender, EventArgs e) { glControl.MakeCurrent(); Display.Init(); SpriteBatch = new SpriteBatch(); // Preload background texture resource CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png")); CheckerBoard.HorizontalWrap = TextureWrapFilter.Repeat; CheckerBoard.VerticalWrap = TextureWrapFilter.Repeat; // Preload texture resources Icons = new TileSet(); Icons.Texture = new Texture2D(ResourceManager.GetInternalResource("DungeonEye.Forms.data.editor.png")); int id = 0; for (int y = 0; y < Icons.Texture.Size.Height - 50; y += 25) { for (int x = 0; x < Icons.Texture.Size.Width; x += 25) { Tile tile = Icons.AddTile(id++); tile.Rectangle = new Rectangle(x, y, 25, 25); } } Icons.AddTile(100).Rectangle = new Rectangle(0, 245, 6, 11); // alcoves Icons.AddTile(101).Rectangle = new Rectangle(6, 248, 11, 6); // alcoves Icons.AddTile(102).Rectangle = new Rectangle(17, 243, 10, 13); // wall switch Icons.AddTile(103).Rectangle = new Rectangle(27, 246, 13, 10); // wall switch RebuildMazeList(); if (Dungeon.StartLocation != null && !string.IsNullOrEmpty(Dungeon.StartLocation.Maze) && MazeListBox.Items.Contains(Dungeon.StartLocation.Maze)) { MazeListBox.SelectedItem = Dungeon.StartLocation.Maze; } else if (MazeListBox.Items.Count > 0) { MazeListBox.SelectedIndex = 0; } DrawTimer.Start(); }
private void Form1_Load(object sender, EventArgs e) { Image busstop = Properties.Resources.p_BusStop /*@"p_BusStop.png"*/; Image passenger = Properties.Resources.p_Passenger /*(@"p_Passenger.png")*/; Image bus = Properties.Resources.p_Bus /*(@"p_Bus.png")*/; town = new Town(Width, Height); draw = new DrawField(town); town.BusStops = new List <BusStop>(); town.BusStops.Add(new BusStop(busstop.Width, busstop.Height, Width, Height)); town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height)); town.BusStops.Add(new BusStop(Width / 2 - busstop.Width + busstop.Width / 3, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height)); town.RandomBusesAndPassengers(); draw = new DrawField(town, busstop, bus, passenger); DrawTimer.Start(); ChangeTimer.Start(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DecorationForm_Load(object sender, System.EventArgs e) { OpenGLBox.MakeCurrent(); Display.ViewPort = new Rectangle(Point.Empty, OpenGLBox.Size); Display.RenderState.ClearColor = Color.Black; Display.RenderState.Blending = true; Display.BlendingFunction(BlendingFactorSource.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); Batch = new SpriteBatch(); // Collect all Tileset definition List <string> list = ResourceManager.GetAssets <TileSet>(); BackgroundTileSetBox.Items.AddRange(list.ToArray()); // Background tileset if (list.Contains(DecorationSet.BackgroundTileset)) { BackgroundTileSetBox.SelectedItem = DecorationSet.BackgroundTileset; } else if (BackgroundTileSetBox.Items.Count > 0) { ChangeBackgroundTileSet((string)BackgroundTileSetBox.Items[0]); BackgroundTileSetBox.SelectedIndex = 0; } // Decoration TileSet list = ResourceManager.GetAssets <TileSet>(); TilesetBox.Items.AddRange(list.ToArray()); if (list.Contains(DecorationSet.TileSetName)) { TilesetBox.SelectedItem = DecorationSet.TileSetName; } //list = ResourceManager.GetAssets<TileSet>(); ItemTileSetBox.Items.AddRange(list.ToArray()); OpenGLBox.MouseWheel += new MouseEventHandler(OpenGLBox_MouseWheel); DrawTimer.Start(); }
/// <summary> /// Time to paint my dear ! /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RenderControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { RenderControl.MakeCurrent(); // Stop the draw timer DrawTimer.Stop(); // Clear the background Display.ClearBuffers(); Batch.Begin(); // Background texture // Background texture Rectangle dst = new Rectangle(Point.Empty, RenderControl.Size); Batch.Draw(CheckerBoard, dst, dst, Color.White); // Draw the layout CurrentLayout.Draw(Batch); // Draw the selection box SelectionBox.Draw(Batch); // If no action and mouse over an element, draw its bounding box if (SelectionBox.MouseTool == MouseTools.NoTool) { Control elem = FindElementAt(RenderControl.PointToClient(System.Windows.Forms.Control.MousePosition)); if (elem != null) { //Display.DrawRectangle(elem.Rectangle, Color.White); } } Batch.End(); RenderControl.SwapBuffers(); // Start the draw timer DrawTimer.Start(); }
private void MainForm_Load(object sender, EventArgs e) { Image busstop = Properties.Resources.p_Conveer; /*@"p_BusStop.png"*/; Image passenger = Properties.Resources.p_Mechanic /*(@"p_Passenger.png")*/; Image bus = Properties.Resources.p_Pogruz /*(@"p_Bus.png")*/; Image revolt = Properties.Resources.mark; town = new Town(Width, Height); draw = new DrawField(town); town.BusStops = new List <Conveer>(); town.BusStops.Add(new Conveer(busstop.Width, busstop.Height, Width, Height)); town.BusStops.Add(new Conveer(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height)); town.BusStops.Add(new Conveer(busstop.Width, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height)); town.BusStops.Add(new Conveer(Width - busstop.Width * 2 - busstop.Width / 2, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height)); town.RandomBusesAndPassengers(); draw = new DrawField(town, busstop, bus, passenger, revolt); DrawTimer.Start(); ChangeTimer.Start(); }
/// <summary> /// ランチャーの読み込み時のイベント /// </summary> private void Launcher_Load(object sender, EventArgs e) { // タスクトレイに追加 AddNotifyIcon(); // マイセットアイコンの初期化&追加 MysetIcon = new GHIconEx(SkinImage.Myset_Open_Icon, SkinImage.Myset_Icon, FormType.Launcher); MysetIcon.control.MouseClick += (s, a) => { if (a.Button == MouseButtons.Left) { if (GHManager.MysetList.FormVisible) { GHManager.MysetList.MouseActive = false; GHManager.MysetList.MysetList_Hide(); } else { GHManager.MysetList.MouseActive = true; GHManager.MysetList.MysetList_Show(); } } }; Controls.Add(MysetIcon.control); // フック開始 if (!Dll.StartHook()) { Application.Exit(); } // ランチャーの位置・サイズを設定 Size = new Size(GHManager.Settings.Style.Launcher.Width, GHManager.Settings.Style.Launcher.Height); SetOffset(GHManager.Settings.Launcher.Offset); animateInfo = new GHAnimateInfo(GHManager.Settings.Animate.Launcher_DelayTime, GHManager.Settings.Animate.Launcher_AnimateTime, GHManager.Settings.Animate.Launcher_Slide, GHManager.Settings.Animate.Launcher_Fade); GHManager.RegistHotKey(Handle); // タイマー開始 DrawTimer.Start(); UpdateTimer.Start(); }
private void ReloadModelBttn_Click(object sender, EventArgs e) { DrawTimer.Dispose(); ChangeTimer.Dispose(); town.Dispose(); Image busstop = Properties.Resources.p_BusStop /*@"p_BusStop.png"*/; Image passenger = Properties.Resources.p_Passenger/*(@"p_Passenger.png")*/; Image bus = Properties.Resources.p_Bus/*(@"p_Bus.png")*/; Image revolt = Properties.Resources.mark; town = new Town(Width, Height); draw = new DrawField(town); town.BusStops = new List<BusStop>(); town.BusStops.Add(new BusStop(busstop.Width, busstop.Height, Width, Height)); town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height)); town.BusStops.Add(new BusStop(busstop.Width, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height)); town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height)); town.RandomBusesAndPassengers(); draw = new DrawField(town, busstop, bus, passenger, revolt); DrawTimer.Start(); ChangeTimer.Start(); }
/// <summary> /// Form loading /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GlControlBox_Load(object sender, EventArgs e) { if (DesignMode) { return; } GlControlBox.MakeCurrent(); Display.Init(); // Spritebatch Batch = new SpriteBatch(); // Preload background texture resource CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png")); CheckerBoard.HorizontalWrap = TextureWrapFilter.Repeat; CheckerBoard.VerticalWrap = TextureWrapFilter.Repeat; // Preload texture resources Icons = new TileSet(); Icons.Texture = new Texture2D(ResourceManager.GetInternalResource("DungeonEye.Forms.data.editor.png")); int id = 0; for (int y = 0; y < Icons.Texture.Size.Height - 50; y += 25) { for (int x = 0; x < Icons.Texture.Size.Width; x += 25) { Tile tile = Icons.AddTile(id++); tile.Rectangle = new Rectangle(x, y, 25, 25); } } Icons.AddTile(100).Rectangle = new Rectangle(0, 245, 6, 11); // alcoves Icons.AddTile(101).Rectangle = new Rectangle(6, 248, 11, 6); // alcoves ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing); DrawTimer.Start(); }
private void button1_Click(object sender, EventArgs e) { Graphics g = Graphics.FromImage(bmp); g.Clear(Color.Black); Draw(g); pictureBox1.Image = bmp; g.Dispose(); DrawTimer.Start(); TubesTimer.Start(); PlayerTimer.Start(); button1.Visible = false; button1.Enabled = false; button2.Visible = false; button2.Enabled = false; button3.Visible = false; button3.Enabled = false; button4.Visible = false; button4.Enabled = false; }
private void FindPathBtn_Click(object sender, EventArgs e) { AddCityPanel.Visible = false; DrawPathBorder.Visible = true; drawcolor = Color.FromArgb(255, rastgele.Next(0, 255), rastgele.Next(0, 255), rastgele.Next(0, 255)); pen.Color = drawcolor; VisitedCityList.Items.Add("*** GÜZERGAH ***"); visitcompleted.Add(40); selectedcity = 40; int n = visiting.Count; //******** EN KISASINI BUL **********// for (int j = 0; j < n; j++) { mindistance = double.PositiveInfinity; for (int i = 0; i < visiting.Count; i++) { if (SolvedCityDistance[selectedcity, visiting[i]] < mindistance) { mindistance = SolvedCityDistance[selectedcity, visiting[i]]; nextcity = visiting[i]; } } Dijkstra(finaluzaklik, selectedcity, nextcity); visiting.Remove(nextcity); selectedcity = nextcity; } Dijkstra(finaluzaklik, selectedcity, 40); for (int i = 0; i < visitcompleted.Count; i++) { VisitedCityList.Items.Add(cityname[visitcompleted[i]]); } counter = 0; DrawTimer.Start(); }
/// <summary> /// OnPaint /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GlControl_Paint(object sender, PaintEventArgs e) { DrawTimer.Stop(); GlControl.MakeCurrent(); Display.ClearBuffers(); Batch.Begin(); // Background texture Rectangle dst = new Rectangle(Point.Empty, GlControl.Size); Batch.Draw(CheckerBoard, dst, dst, Color.White);; Batch.DrawString(CurrentFont, Point.Empty, Color.White, PreviewTextBox.Text); Batch.End(); DrawTimer.Start(); GlControl.SwapBuffers(); }
void PowerManager_IsMonitorOnChanged(object sender, EventArgs e) { if (PowerManager.IsMonitorOn) { Logger.QueueLine("Monitor has turned on, resuming LEDs"); LEDSetup.LEDS_ON = true; if (LEDSetup.ActivePort != null) { if (sColors != null) { DrawTimer.Start(); } if (aColors != null) { aColors.wi.StartRecording(); } } } else { Logger.QueueLine("Monitor has turned off, disabling LEDs"); LEDSetup.LEDS_ON = false; if (LEDSetup.ActivePort != null) { if (sColors != null) { DrawTimer.Stop(); } if (aColors != null) { aColors.wi.StopRecording(); } System.Threading.Thread.Sleep(50); LEDSetup.drawOff(); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AnimationForm_Load(object sender, EventArgs e) { GlTilesControl.MakeCurrent(); Display.Init(); GlFramesControl.MakeCurrent(); Display.Init(); GlPreviewControl.MakeCurrent(); Display.Init(); SpriteBatch = new SpriteBatch(); // Preload background texture resource CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png")); CheckerBoard.HorizontalWrap = TextureWrapFilter.Repeat; CheckerBoard.VerticalWrap = TextureWrapFilter.Repeat; BuildInterface(); // Draw timer DrawTimer.Start(); }
private void DrawTimer_Tick(object sender, EventArgs e) { CurrentState.DrawTime += 1; DrawTimeLabel.Text = "Draw Time: " + CurrentState.DrawTime.ToString() + " s"; DrawTimer.Start(); }
// Start Game When Clicked. private void Start_Click(object sender, EventArgs e) { DrawTimer.Start(); PlayArea.Focus(); }
public void Start() { // Show the form that the user feedback image is drawn on drawingForm.Show(); DrawTimer.Start(); }