public void Run(Scene scene, SceneOptions options)
 {
     var window = new GraphicsWindow(scene);
     var view = new ElementView(options);
     scene.Initialize(view);
     window.Content = view;
     window.ShowDialog();
 }
示例#2
0
 public MainPage()
 {
     InitializeComponent();
     var sceneOptions = new SceneOptions("/Images/800x600", 50, 42);
     _scene = new Scene(sceneOptions);
     var view = new ElementView(sceneOptions);
     _scene.Initialize(view);
     LayoutRoot.Children.Add(view);
     CompositionTarget.Rendering += new System.EventHandler(CompositionTarget_Rendering);
 }
 public void Run(Scene scene, SceneOptions options)
 {
     using (var form = new GraphicsForm(scene))
     {
         var view = new PictureBoxView(options);
         scene.Initialize(view);
         form.SetView(view);
         form.ShowDialog();
     }
 }
示例#4
0
 public MainPage()
 {
     InitializeComponent();
     new Uri("pack://application,,,/Images/800x600/BackgroundTile.bmp");
     var sceneOptions = new SceneOptions("ms-resource://MyAssembly/Images/800x600", 50, 42);
     _scene = new Scene(sceneOptions);
     var view = new ElementView(sceneOptions);
     _scene.Initialize(view);
     LayoutRoot.Children.Add(view);
     CompositionTarget.Rendering += CompositionTarget_Rendering;
 }
示例#5
0
 public CustomPaintView(SceneOptions options)
 {
     _options = options;
     InitializeComponent();
     SetStyle(
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.Opaque |
         ControlStyles.OptimizedDoubleBuffer |
         ControlStyles.UserPaint,
         true);
     SetStyle(
         ControlStyles.ContainerControl |
         ControlStyles.SupportsTransparentBackColor,
         false);
 }
 public ElementView(SceneOptions sceneOptions)
 {
     _sceneOptions = sceneOptions;
     InitializeComponent();
 }
示例#7
0
 private void Run(IController controller, string directoryName, int tileWidth, int tileHeight)
 {
     var exeDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
     var imageDirectory = Path.Combine(exeDirectory, "Images", directoryName);
     var options = new SceneOptions(imageDirectory, tileWidth, tileHeight);
     var scene = new Scene(options);
     controller.Run(scene, options);
     LogResults(controller, scene);
 }
示例#8
0
 public PictureBoxView(SceneOptions options)
 {
     _options = options;
     InitializeComponent();
 }
示例#9
0
 public MvvmSprite(ImageSource imageSource, SceneOptions options)
 {
     ImageSource = imageSource;
     _options = options;
 }
示例#10
0
 public MvvmView(SceneOptions options)
 {
     _options = options;
     InitializeComponent();
     DataContext = _sprites;
 }
示例#11
0
 public PictureBoxSprite(PictureBox control, SceneOptions options)
 {
     _control = control;
     _options = options;
 }