-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
54 lines (50 loc) · 3.99 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Window x:Name="MyWindow" x:Class="Paratrooper2049.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Paratrooper2049" Width="800" Height="500" WindowStyle="None" AllowsTransparency="True" Background="Transparent" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
<Canvas x:Name="MyCanvas" Focusable="True" KeyDown="OnKeyDown" KeyUp="OnKeyUp">
<Rectangle Height="500" Width="800" RadiusX="10" RadiusY="10">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="LightCoral" />
<GradientStop Color="LightGreen" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Grid Height="500" Width="800">
<Grid.RowDefinitions>
<RowDefinition Height="3*" />
<RowDefinition Height="5*" />
<RowDefinition Height="5*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="PARATROOPER " HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="90" FontWeight="Bold"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" RenderTransformOrigin="0.5,0.5" Margin="0,5,0,0">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="-5" />
</TransformGroup>
</Label.RenderTransform>
</Label>
<Label Content="Instruction" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" FontSize="30" FontWeight="Bold" Margin="30,50,0,0" />
<Label Content="S: Start a new game
P: Game pause
Esc: Exit
Key Up: Fire
Key Left/Right: Rotate cannon;
Space bar: Change weapon"
HorizontalAlignment="Left" Grid.Row="1" Grid.RowSpan="2" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="26" Margin="50,100,0,0" />
<Label Content="Battlefield area" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" FontSize="30" FontWeight="Bold" Margin="40,50,0,0" />
<Label x:Name="SettingLabel" Content="Windowed" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" FontSize="26" Foreground="Black"
MouseEnter="label_MouseEnter" MouseLeave="label_MouseLeave" MouseLeftButtonUp="SettingLabel_MouseLeftButtonUp" Margin="60,100,0,0" />
<TextBox x:Name="formWi" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" FontSize="26" Width="80" Margin="0,105,100,0" Text="800" TextAlignment="Center" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Right" />
<TextBox x:Name="formHe" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" FontSize="26" Width="80" Margin="80,105,20,0" Text="500" TextAlignment="Center" Background="{x:Null}" BorderBrush="{x:Null}" HorizontalAlignment="Right" />
<Label Content="Difficult level" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" VerticalAlignment="Top" FontSize="30" FontWeight="Bold" Margin="40,0,0,0" />
<Label x:Name="LevelLabel" Content="Easy" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" VerticalAlignment="Top" FontSize="26" Foreground="Black"
MouseEnter="label_MouseEnter" MouseLeave="label_MouseLeave" MouseLeftButtonUp="LevelLabel_MouseLeftButtonUp" Margin="60,50,0,0" />
</Grid>
</Canvas>
</Window>