/// <summary> /// Draws a frame /// </summary> /// <param name = "gameTime" /> void IDraw.Draw(GameTime gameTime) { bool sunburnSplashScreenDisplayComplete = SplashScreen.DisplayComplete; if (sunburnSplashScreenDisplayComplete) { BeginFrame(gameTime); } for (int i = 0; i < Layers.Count; i++) { ILayer layer = Layers[i]; if (layer is SunBurnLayer && !sunburnSplashScreenDisplayComplete) { continue; } if (layer.IsVisible) { layer.BeginDraw(gameTime); layer.Draw(gameTime); layer.EndDraw(gameTime); } } Draw(gameTime); if (sunburnSplashScreenDisplayComplete) { EndFrame(); } }
public GenerationDialog(ILayer layer) { InitializeComponent(); this.WindowStartupLocation = WindowStartupLocation.CenterScreen; this.Activate(); previewCanvas.MouseLeftButtonDown += new MouseButtonEventHandler(previewCanvas_MouseLeftButtonDown); previewCanvas.MouseMove += new MouseEventHandler(previewCanvas_MouseMove); previewCanvas.MouseLeftButtonUp += new MouseButtonEventHandler(previewCanvas_MouseLeftButtonUp); previewCanvas.MouseLeave += new MouseEventHandler(previewCanvas_MouseLeave); cloneLayer = layer; previewCanvas.Width = MainWindow.canvSize.Width; previewCanvas.Height = MainWindow.canvSize.Height; this.Width = MainWindow.canvSize.Width + 250; this.Height = MainWindow.canvSize.Height + 50; canvasDrawer = new CanvasDrawer(previewCanvas); cloneLayer.Draw(canvasDrawer); }
private void Refresh() { previewCanvas.Children.Clear(); cloneLayer.Draw(canvasDrawer); }