Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:bhaviksingh/Choreoh

  • Loading branch information...
commit 994dc1ab647c8b98a15676751174ea6c280a4b40 2 parents f4321b5 + 9b54b2a
Kenny Do authored
3  Choreoh/Choreoh.csproj
View
@@ -161,6 +161,9 @@
<ItemGroup>
<Resource Include="english_words.txt" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="img\ui\Hand.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
4 Choreoh/MainWindow.xaml
View
@@ -52,7 +52,7 @@
<Canvas Name="recordingCanvas" Canvas.Top="50" Canvas.Left="306" Height="320" Width="420" Panel.ZIndex="100" Visibility="Hidden" Background="Red">
<my:KinectColorViewer Canvas.Left ="-30" Width="480" Height="320" Name="recordingColorViewer" Kinect="{Binding ElementName=kinectSensorChooser1, Path=Kinect}" Panel.ZIndex="100"></my:KinectColorViewer>
<my:KinectSkeletonViewer Canvas.Left="0" Name="recordingSkeletonViewer" Width="420" Height="320" Kinect="{Binding ElementName=kinectSensorChooser1, Path=Kinect}" Panel.ZIndex="100"></my:KinectSkeletonViewer>
- <local:RadialMenu x:Name="radialMenu" Visibility="Visible" TopText="Top" LeftText="Leftn" RightText="Right" BottomText="Cancel" bottomClick="bottom_Click" Canvas.Left="-185" Canvas.Top="-49" Panel.ZIndex="200" />
+
</Canvas>
<TextBox Canvas.Left="12" Canvas.Top="697" Height="59" Width="986" Name="debug" FontSize="20" />
@@ -65,7 +65,7 @@
<local:HoverButton Canvas.Left="88" Canvas.Top="412" Height="250" x:Name="song4" Width="250" BackgroundColor="#FF1F73B7" Text="Hot Interface &#10; - 160 cent" VerticalTextAlignment="Top" HorizontalTextAlignment="Left" HorizontalAlignment="Left" CornerRadius="2"/>
<local:HoverButton Canvas.Left="372" Canvas.Top="412" Height="250" x:Name="song5" Width="250" BackgroundColor="#FF1F73B7" Text="Wonderwall &#10; - Oasis" VerticalTextAlignment="Top" HorizontalTextAlignment="Left" HorizontalAlignment="Left" CornerRadius="2"/>
</Canvas>
-
+ <local:RadialMenu x:Name="radialMenu" Visibility="Collapsed" TopText="Top" LeftText="Leftn" RightText="Right" BottomText="Cancel" bottomClick="bottom_Click" Canvas.Left="-185" Canvas.Top="-49" />
<local:HandCursor x:Name="hand" Canvas.Top="79" Canvas.Left="256" GestureEvent="hand_GestureEvent" Panel.ZIndex="999" />
</Canvas>
12 Choreoh/MainWindow.xaml.cs
View
@@ -109,11 +109,11 @@ private void waveform_Clicked(object sender, EventArgs e)
Point handPosition = hand.TransformToAncestor(mainCanvas).Transform(new Point(0, 0));
menuY = handPosition.Y;
- menuY = menuY + hand.ActualHeight / 2;
+ menuY = menuY + hand.ActualHeight / 2 - radialMenu.getDiameter()/2;
menuX = handPosition.X;
- menuX = menuX + hand.ActualWidth / 2;
- Canvas.SetLeft(radialMenu, menuX - radialMenu.ActualWidth / 2);
- Canvas.SetTop(radialMenu, menuY - radialMenu.ActualHeight / 2);
+ menuX = menuX + hand.ActualWidth / 2 - radialMenu.getDiameter()/2;
+ Canvas.SetLeft(radialMenu, menuX );
+ Canvas.SetTop(radialMenu, menuY);
hand.menuOpened = true;
hand.SetRadialMenu(handPosition.X, handPosition.Y, radialMenu);
@@ -202,8 +202,8 @@ private void button_Clicked(object sender, EventArgs e)
menuY = menuY + hand.ActualHeight / 2;
menuX = handPosition.X;
menuX = menuX + hand.ActualWidth / 2;
- Canvas.SetLeft(radialMenu, menuX - radialMenu.ActualWidth / 2);
- Canvas.SetTop(radialMenu, menuY - radialMenu.ActualHeight / 2);
+ Canvas.SetLeft(radialMenu, menuX - radialMenu.getDiameter() / 2);
+ Canvas.SetTop(radialMenu, menuY - radialMenu.getDiameter() / 2);
hand.menuOpened = true;
hand.SetRadialMenu(handPosition.X, handPosition.Y, radialMenu);
radialMenu.Visibility = Visibility.Visible;
8 Choreoh/RadialAnimate.cs
View
@@ -50,26 +50,26 @@ public void expand(Image control, String direction)
switch (direction)
{
case ("Left"):
- dax.KeyFrames.Add(new LinearDoubleKeyFrame(-80, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
+ dax.KeyFrames.Add(new LinearDoubleKeyFrame(-128, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
day.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
control.RenderTransform = leftTrans;
leftTrans.BeginAnimation(TranslateTransform.XProperty, dax);
break;
case ("Top"):
dax.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
- day.KeyFrames.Add(new LinearDoubleKeyFrame(-80, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
+ day.KeyFrames.Add(new LinearDoubleKeyFrame(-128, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
control.RenderTransform = topTrans;
topTrans.BeginAnimation(TranslateTransform.YProperty, day);
break;
case ("Right"):
- dax.KeyFrames.Add(new LinearDoubleKeyFrame(80, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
+ dax.KeyFrames.Add(new LinearDoubleKeyFrame(128, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
day.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
control.RenderTransform = rightTrans;
rightTrans.BeginAnimation(TranslateTransform.XProperty, dax);
break;
case ("Bottom"):
dax.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
- day.KeyFrames.Add(new LinearDoubleKeyFrame(80, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
+ day.KeyFrames.Add(new LinearDoubleKeyFrame(128, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2))));
control.RenderTransform = bottomTrans;
bottomTrans.BeginAnimation(TranslateTransform.YProperty, day);
break;
32 Choreoh/RadialMenu.xaml
View
@@ -5,22 +5,22 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
x:Name="menu"
- d:DesignHeight="500" d:DesignWidth="500" Width="424" Height="420">
- <Canvas Width="420" Height="421">
- <Image Name="RadialLeft" Source="Images/RadialLeft.png" Width="210" Height="300" Canvas.Left="0" Canvas.Top="60" Panel.ZIndex="100" />
- <Image Name="RadialTop" Source="Images/RadialTop.png" Width="300" Height="210" Canvas.Left="60" Canvas.Top="0" Panel.ZIndex="100" />
- <Image Name="RadialRight" Source="Images/RadialRight.png" Width="210" Height="300" Canvas.Left="210" Canvas.Top="58" Panel.ZIndex="98"/>
- <Image Name="RadialBottom" Source="Images/RadialBottom.png" Width="300" Height="210" Canvas.Left="60" Canvas.Top="209" Panel.ZIndex="100"/>
- <Image Name="RadialMiddle" Source="Images/RadialMiddle.png" Width="92" Height="92" Canvas.Left="165" Canvas.Top="164" Panel.ZIndex="100"/>
- <Image Name="RadialHighRight" Source="Images/RadialHighRight.png" Width="210" Opacity=".6" Height="298" Canvas.Left="41" Canvas.Top="59" Panel.ZIndex="99" />
- <Image Name="RadialHighBottom" Source="Images/RadialHighBottom.png" Width="298" Opacity=".6" Height="210" Canvas.Left="62" Canvas.Top="39" Panel.ZIndex="96" />
- <Image Name="RadialHighTop" Source="Images/RadialHighTop.png" Width="298" Opacity=".6" Height="210" Canvas.Left="60" Canvas.Top="170" Panel.ZIndex="96" />
- <Image Name="RadialHighLeft" Source="Images/RadialHighLeft.png" Width="210" Opacity=".6" Height="298" Canvas.Left="172" Canvas.Top="61" Panel.ZIndex="96" />
- <Ellipse Name="RadialOuter" Fill="White" StrokeThickness="3" Width="420" Height="420" Canvas.Left="0" Canvas.Top="-1" Panel.ZIndex="94" Stroke="#FFDEDEDE" />
- <TextBlock Canvas.Left="100" Canvas.Top="37" Text="{Binding Path=TopText, ElementName=menu}" Width="218" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" TextWrapping="Wrap" Height="63" />
- <TextBlock Canvas.Left="100" Canvas.Top="318" Text="{Binding Path=BottomText, ElementName=menu}" Width="218" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" TextWrapping="Wrap" Height="63" />
- <TextBlock Canvas.Left="12" Canvas.Top="142" Text="{Binding Path=LeftText, ElementName=menu}" Width="128" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" Height="134" TextWrapping="Wrap" Padding="0,30,0,10"/>
- <TextBlock Canvas.Left="277" Canvas.Top="142" Text="{Binding Path=RightText, ElementName=menu}" FontSize="35" FontFamily="..\img\ui\#Nevis" Foreground="#FF5F5F5F" Height="134" Panel.ZIndex="101" TextAlignment="Center" TextWrapping="Wrap" Width="128" Padding="0,30,0,10"/>
+ d:DesignHeight="319" d:DesignWidth="319" Width="319" Height="319">
+ <Canvas Width="319" Height="319">
+ <Image Name="RadialLeft" Source="Images/RadialLeft.png" Width="160" Height="220" Canvas.Left="0" Canvas.Top="48" Panel.ZIndex="100" />
+ <Image Name="RadialTop" Source="Images/RadialTop.png" Width="220" Height="160" Canvas.Left="47" Canvas.Top="0" Panel.ZIndex="100" />
+ <Image Name="RadialRight" Source="Images/RadialRight.png" Width="160" Height="220" Canvas.Left="155" Canvas.Top="48" Panel.ZIndex="98"/>
+ <Image Name="RadialBottom" Source="Images/RadialBottom.png" Width="220" Height="160" Canvas.Left="48" Canvas.Top="156" Panel.ZIndex="100"/>
+ <Image Name="RadialMiddle" Source="Images/RadialMiddle.png" Width="65" Height="65" Canvas.Left="124" Canvas.Top="124" Panel.ZIndex="100"/>
+ <Image Name="RadialHighRight" Source="Images/RadialHighRight.png" Width="160" Opacity=".6" Height="220" Canvas.Left="27" Canvas.Top="47" Panel.ZIndex="99" />
+ <Image Name="RadialHighBottom" Source="Images/RadialHighBottom.png" Width="220" Opacity=".6" Height="160" Canvas.Left="48" Canvas.Top="27" Panel.ZIndex="96" />
+ <Image Name="RadialHighTop" Source="Images/RadialHighTop.png" Width="220" Opacity=".6" Height="160" Canvas.Left="46" Canvas.Top="130" Panel.ZIndex="96" />
+ <Image Name="RadialHighLeft" Source="Images/RadialHighLeft.png" Width="160" Opacity=".6" Height="220" Canvas.Left="128" Canvas.Top="47" Panel.ZIndex="96" />
+ <Ellipse Name="RadialOuter" Fill="White" StrokeThickness="3" Width="315" Height="317" Canvas.Left="0" Canvas.Top="-1" Panel.ZIndex="94" Stroke="#FFDEDEDE" />
+ <TextBlock Canvas.Left="80" Canvas.Top="26" Text="{Binding Path=TopText, ElementName=menu}" Width="156" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" TextWrapping="Wrap" Height="47" />
+ <TextBlock Canvas.Left="80" Canvas.Top="241" Text="{Binding Path=BottomText, ElementName=menu}" Width="156" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" TextWrapping="Wrap" Height="47" />
+ <TextBlock Canvas.Left="12" Canvas.Top="106" Text="{Binding Path=LeftText, ElementName=menu}" Width="96" Foreground="#FF5F5F5F" Panel.ZIndex="101" FontSize="35" FontFamily="..\img\ui\#Nevis" TextAlignment="Center" Height="97" TextWrapping="Wrap" Padding="0,30,0,10"/>
+ <TextBlock Canvas.Left="207" Canvas.Top="106" Text="{Binding Path=RightText, ElementName=menu}" FontSize="35" FontFamily="..\img\ui\#Nevis" Foreground="#FF5F5F5F" Height="97" Panel.ZIndex="101" TextAlignment="Center" TextWrapping="Wrap" Width="96" Padding="0,30,0,10"/>
</Canvas>
</UserControl>
5 Choreoh/RadialMenu.xaml.cs
View
@@ -41,6 +41,11 @@ private void setSize(int diameter)
}
+ public int getDiameter()
+ {
+ return 319;
+ }
+
#region Properties
public static readonly DependencyProperty TopTextProperty = DependencyProperty.Register(
Please sign in to comment.
Something went wrong with that request. Please try again.