Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Transfer from Blend to Noesis app

14 Apr 2015, 13:55

I created an animated logo in Blend. This logo has 120 frames/images and I'm using a storyboard to "flip" (turn on/off visibility at 20 frames per second). For right now I'm leaving the frames as individual images instead of making an atlas just to get it working. I'll go back and make them an atlas later when I want to optimize it.

So now I have my xaml and 120 images. I put my xaml file where my exe is, and I copied my images to the resource directory I registered. When I start my C++ app it says it can't find MainWindow.xaml. Now I copied the examples over and have Tux.xaml in the same dir as my exe and copied all those .nsb files to my resource directory for the samples, but don't have any nsb files for my new logo animation.

I assume I need these somewhere? What is an nsb file and why are they needed? It seems there are nsb files for each xaml and images and fonts. Is this something I have to do to get this working?
 
Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Re: Transfer from Blend to Noesis app

14 Apr 2015, 18:38

OK, I see I have to use the Build tool. So I did that and it converted all the png files just fine, but getting an error when it tries to parse the xaml file.

Parsing Window (@1,1).
Unknown type 'DALogo.MainWindow'

Part of my xaml that probably is relevant (because it's huge)

<Window x:Name="window" x:Class="DALogo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="600" Width="800">

So obviously Noesis doesn't know what DALogo.MainWindow is. Not sure what to do about that.
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Transfer from Blend to Noesis app

14 Apr 2015, 19:34

Yes, you need to use the BuildTool to preprocess all resources to NSB files that noesisGUI understands at execution time.

Regarding the x:Class directive, it is used for using code-behind classes as explained in the Application Prototyping tutorial. If you need it, you have to provide an extension (.DLL) for the builldtool as explained in the Extending NoesisGUI tutorial.

If you don't need that, you can simply remove the x:Class directive automatically added by Blend.
 
Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Re: Transfer from Blend to Noesis app

14 Apr 2015, 19:56

So I removed that class and now I'm getting an error on startup

"SystemWindow implementation not found"

So the below is how my file starts and the ObjectAnimationUsingKeyFrames tags repeat a ton of times (just removed the class as I'm not interested in a code behind at this time)
<Window x:Name="window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="600" Width="800">
	<Window.Resources>
		<Storyboard x:Key="LogoStoryBoard">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="dialogo0001">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.05" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="dialogo0002">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.05" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.1" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>

Then it goes to the below where the images are repeated a bunch of times and then it just ends. This works in Blend.
</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource LogoStoryBoard}"/>
		</EventTrigger>
	</Window.Triggers>
    <Grid x:Name="grid">
    	<Image x:Name="dialogo0001" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0001.png" Stretch="Fill"/>
		<Image x:Name="dialogo0002" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0002.png" Stretch="Fill" Visibility="Hidden" Margin="0,5,0,-5"/>
		<Image x:Name="dialogo0003" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0003.png" Stretch="Fill" Visibility="Hidden"/>
		<Image x:Name="dialogo0004" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0004.png" Stretch="Fill" Visibility="Hidden"/>
		<Image x:Name="dialogo0005" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0005.png" Stretch="Fill" Visibility="Hidden"/>
		<Image x:Name="dialogo0006" HorizontalAlignment="Left" VerticalAlignment="Top" Source="dalogo0006.png" Stretch="Fill" Visibility="Hidden"/>
Last edited by Rick on 14 Apr 2015, 20:00, edited 2 times in total.
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Transfer from Blend to Noesis app

14 Apr 2015, 20:00

Does that XAML display properly in the XamlPlayer?
 
Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Re: Transfer from Blend to Noesis app

14 Apr 2015, 20:04

Yes, and no.

When I drag in my xaml into the XAML player it pauses for some time (what seems to be the length of the animation) and then displays another window with the last frame of the animation in it. So it's like as it's animating it doesn't show the window of my xaml but once the animation is complete it shows the window and the last frame.


[EDIT]

Wait, now after dragging it a few times it does play the animation in the XAML player.

Also, I'd prefer not to have a separate window open, but not sure where I would put all those other tags under the window tag to get it to work.
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Transfer from Blend to Noesis app

14 Apr 2015, 20:11

Ups, sorry for overlooking that. Do not use the <Window> container because it creates an Operating System window and we only support that in the XamlPlayer for application prototyping. That is the explanation to the error you are having in your your game. You need to use another container like Grid or Canvas.
 
Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Re: Transfer from Blend to Noesis app

14 Apr 2015, 20:15

So I have a grid container in my xaml file (that is nested in the window). If I remove the Window what happens to all those other resource tags under my Window? How do I handle those? They need to be children of something right?

Like what would: <Window.Resources> become if I made the root a Grid tag?

Also I have these triggers

<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource LogoStoryBoard}"/>
</EventTrigger>
</Window.Triggers>
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: Transfer from Blend to Noesis app

14 Apr 2015, 20:19

Instead of using Window. you must use Grid.
<Grid.Resources>
<Grid.Triggers>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
        <BeginStoryboard Storyboard="{StaticResource LogoStoryBoard}"/>
    </EventTrigger>
</Grid.Triggers>
Probably, Blend can do that automatically for you.
 
Rick
Topic Author
Posts: 50
Joined: 26 Nov 2013, 15:35

Re: Transfer from Blend to Noesis app

15 Apr 2015, 03:34

Got it working. Thank you much!

Who is online

Users browsing this forum: No registered users and 3 guests