private void lstSprites_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { SpriteObject obj = (lstSprites.SelectedItem as SpriteObject); if (obj != null) { // Space not possible switch (e.Key) { case Key.Delete: ThisLevel.Sprites.Remove(obj); MainGFX.RemoveObject(obj); lstSprites.Items.Refresh(); break; case Key.Enter: obj.Animated = !obj.Animated; lstSprites.Items.Refresh(); break; default: break; } } }
private void cmdSetLevelBkg_Click(object sender, RoutedEventArgs e) { MainGFX.RemoveObject(ThisLevel.LevelBkg); ThisLevel.LevelBkg = new SpriteObject(); ThisLevel.LevelBkg.Name = "LevelBkg"; ThisLevel.LevelBkg.CenterOfMass = new Vector(0, 0); ThisLevel.LevelBkg.IsMovable = false; ThisLevel.LevelBkg.IsObstacle = false; ThisLevel.selectImage(ThisLevel.LevelBkg); (ThisLevel.LevelBkg as SpriteObject).ZoomPreserveAspectRatio(height: GameWrapper.Height); (ThisLevel.Background as SpriteObject).ScrollScaling = (ThisLevel.Background.SizeV.X - (GameWrapper.Width / 2)) / ThisLevel.LevelBkg.SizeV.X; MainGFX.AddObject(ThisLevel.LevelBkg); MainGFX.Width = ThisLevel.LevelBkg.SizeV.X; }
private void cmdSetParBkg_Click(object sender, RoutedEventArgs e) { //MainGFX.Height = 50; //GameWrapper.Width = 50; MainGFX.RemoveObject(ThisLevel.Background); ThisLevel.Background = new SpriteObject(); ThisLevel.Background.Name = "Background"; ThisLevel.Background.CenterOfMass = new Vector(0, 0); ThisLevel.Background.IsMovable = false; ThisLevel.Background.IsObstacle = false; ThisLevel.selectImage(ThisLevel.Background); (ThisLevel.Background as SpriteObject).ZoomPreserveAspectRatio(height: GameWrapper.Height); MainGFX.AddObject(ThisLevel.Background); MainGFX.Width = ThisLevel.Background.SizeV.X; // todo: eigentlich in setlvlbackg //MainGFX.Width = thisLevel.Background.SizeV.X; // MainGFX.Height = 500; }