Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Error Building with Texture Atlas

05 Aug 2014, 03:59

I am attempting to reference a simple test texture atlas in my UI but when I compile the UI using the BuildTool I get the following error:

"Can't add property to another one"

My texture atlas xaml is song_select_resource_dict.xaml:
<!-- Created using Noesis XAML exporter for TexturePacker (http://www.texturepacker.com) -->
<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<ImageBrush x:Key="gradesmall_aaa" ImageSource="gradesmall_aaa.png" Viewbox="0,0,33,54" ViewboxUnits="Absolute" Stretch="Fill" />
</ResourceDictionary>
One of my xaml files which references this file is:
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:noesis="clr-namespace:NoesisGUIExtensions" x:Class="SongSelect" x:Name="SongSelectControl" UseLayoutRounding="True" Height="71.333" Width="558">
  <UserControl.Resources>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="song_select_resource_dict.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <LinearGradientBrush x:Key="textsilver" EndPoint="0.5,1" StartPoint="0.5,0">
      <GradientStop Color="White" Offset="0.086" />
      <GradientStop Color="White" Offset="0.15" />
      <GradientStop Color="#FFB8B8B8" Offset="0.218" />
      <GradientStop Color="#FFEFEFF2" Offset="0.473" />
      <GradientStop Color="#FF82848D" Offset="0.5" />
      <GradientStop Color="White" Offset="0.721" />
      <GradientStop Color="#FFF0F2F2" Offset="1" />
    </LinearGradientBrush>
  </UserControl.Resources>
  <Grid Margin="0,-50,0,50">
    <Canvas x:Name="bg" Margin="0,51,88,2">
      <Path Data="M0.210809,54.6106 L15.5682,69.9679 L557.333,69.9679 L557.333,0 L16.5019,0 L0,16.5019" Fill="White" Height="69.666" Canvas.Left="0" Stretch="None" Canvas.Top="0.167" Width="557.333" UseLayoutRounding="False" />
      <Path Data="M458.791,25.6111 L0,25.6111 L0,0 L458.791,0 z" Fill="#FF1A1A1A" Height="25.332" Canvas.Left="92.176" Stretch="None" Canvas.Top="6.94" Width="458.714" UseLayoutRounding="False" />
      <Path Data="M458.791,25.6111 L0,25.6111 L0,0 L458.791,0 z" Fill="#FF1A1A1A" Height="25.334" Canvas.Left="92.176" Stretch="None" Canvas.Top="38.328" Width="458.714" UseLayoutRounding="False" />
      <Path x:Name="clearlamp" Data="M0,44.1749 L13.6846,57.0001 L13.6846,0 L0,12.8249 z" Fill="#FFEC1C24" Height="57" Canvas.Left="7.375" Stretch="None" Canvas.Top="6.79" Width="13.57" UseLayoutRounding="False" />
      <Image x:Name="difficultybg" Source="difficultybg_nov.png" Stretch="Fill" Height="57" Canvas.Left="28" Canvas.Top="7" Width="57" />
    </Canvas>
    <TextBlock x:Name="title" HorizontalAlignment="Left" Margin="94,57,0,-9" TextWrapping="Wrap" VerticalAlignment="Top" Width="455" Height="23" FontFamily="fonts/mplus-2m-bold.ttf#M+ 2m" Foreground="White" FontWeight="Bold" Text="{Binding TitleText, ElementName=SongSelectControl}" FontSize="18.667" TextAlignment="Center" />
    <TextBlock x:Name="artist" HorizontalAlignment="Left" Height="26" Margin="94,89,0,-44" TextWrapping="Wrap" VerticalAlignment="Top" Width="455" FontFamily="fonts/mplus-2m-bold.ttf#M+ 2m" Foreground="White" RenderTransformOrigin="0.494,0.517" FontSize="18.667" TextAlignment="Center" FontWeight="Bold" Text="{Binding ArtistText, ElementName=SongSelectControl}" />
    <Image x:Name="rank" Margin="501,89,6,-44" Source="{StaticResource gradesmall_aaa}" />
    <TextBlock x:Name="level" noesis:Text.Stroke="Black" noesis:Text.StrokeThickness="2.5" TextWrapping="Wrap" FontFamily="fonts/Machine LT Bold.ttf#Machine LT" FontSize="56" Foreground="#FFF1F1F1" Margin="29,55,474,-42" TextAlignment="Center" Text="00" />
  </Grid>
</UserControl>
I could also supply the log from the BuildTool if that would help - I would paste it but it contains binary and is difficult to copy/paste.

Any ideas why I might be getting this error? Thanks.
 
User avatar
sfernandez
Site Admin
Posts: 3152
Joined: 22 Dec 2011, 19:20

Re: Error Building with Texture Atlas

05 Aug 2014, 10:08

I think the error is in how you specified the Resources property, it should be done like this:
<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="song_select_resource_dict.xaml" />
        </ResourceDictionary.MergedDictionaries>
        <LinearGradientBrush x:Key="textSilver" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop .../>
        <!-- ... -->
    </ResourceDictionary>
</UserControl.Resources>
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Error Building with Texture Atlas

05 Aug 2014, 14:07

Ah, whoops. I am doing a lot of processing of the xamls through build scripts after they are edited in Blend and before they are run through the BuiildTool and I see I am messing up that section. Thanks for pointing that out :)

Who is online

Users browsing this forum: Ahrefs [Bot], Hazberg and 1 guest