- Keyboarder
- Posts: 21
- Joined:
Re: noesisGUI v1.2 BETA 7
I've noticed that this perticular Storyboard property behaves static, that is, it changes on every object instance of the same class, independently of where it's played. However all other properties appear normal and affect only targeted instance.
Storyboard property:
Element:
These are used in background/foreground color switching context, so the current workaround is to have 2 labels layered with different colors and then just lerp between them. Hope it helps.
Storyboard property:
Code: Select all
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="TitleLabel">
<EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/>
</ColorAnimationUsingKeyFrames>
Code: Select all
<Label x:Name="TitleLabel" Content="Label" VerticalAlignment="Center" Margin="15,0" FontSize="40" IsEnabled="False"/>
Re: noesisGUI v1.2 BETA 8
Let us check this tomorrow. We have been very busy with the release of new b8 (that you should also update to).
Thanks for your feedback!
Thanks for your feedback!
-
sfernandez
Site Admin
- Posts: 3093
- Joined:
Re: noesisGUI v1.2 BETA 7
I've tried a simple scene like this using our default style:I've noticed that this perticular Storyboard property behaves static, that is, it changes on every object instance of the same class, independently of where it's played. However all other properties appear normal and affect only targeted instance.
Storyboard property:Element:Code: Select all<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="TitleLabel"> <EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/> </ColorAnimationUsingKeyFrames>
These are used in background/foreground color switching context, so the current workaround is to have 2 labels layered with different colors and then just lerp between them. Hope it helps.Code: Select all<Label x:Name="TitleLabel" Content="Label" VerticalAlignment="Center" Margin="15,0" FontSize="40" IsEnabled="False"/>
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<Storyboard x:Key="anim" AutoReverse="True" RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="lbl">
<EasingColorKeyFrame KeyTime="0:0:1" Value="Red"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<Grid.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{StaticResource anim}"/>
</EventTrigger.Actions>
</EventTrigger>
</Grid.Triggers>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Background="Pink">
<Label x:Name="lbl" Content="first label"/>
<Label Content="second label"/>
</StackPanel>
</Grid>
What kind of template are you using in your Label control?
Re: noesisGUI v1.2 BETA 8
Is it possible to make text created in InkScape work out of the box?
There are two problems:
-The FontFamily property exported by inkscape does not include a hash (#) character, causing a parsing error. Is it really necessary to have this in there?
-Inkscape does not put the actual text in the Text property, but uses span instead, which looks like this:
<Span whiteSpaceCollapse="preserve" FontSize="60">Some text here</Span>
Any chance in supporting this?
I am trying to reduce the manual work required on an XAML exported by InkScape and this will help a lot.
There are two problems:
-The FontFamily property exported by inkscape does not include a hash (#) character, causing a parsing error. Is it really necessary to have this in there?
-Inkscape does not put the actual text in the Text property, but uses span instead, which looks like this:
<Span whiteSpaceCollapse="preserve" FontSize="60">Some text here</Span>
Any chance in supporting this?
I am trying to reduce the manual work required on an XAML exported by InkScape and this will help a lot.
-
sfernandez
Site Admin
- Posts: 3093
- Joined:
Re: noesisGUI v1.2 BETA 8
When FontFamily doesn't include a hash, it refers to OS installed fonts. In NoesisGUI we don't use support that. We can interpret FontFamily="Arial" the same as FontFamily="#Arial", but remember that you have to copy the corresponding .ttf fonts next to the xaml file so it can be found.-The FontFamily property exported by inkscape does not include a hash (#) character, causing a parsing error. Is it really necessary to have this in there?
Full support for inlines is planeed after 1.2 release. If you need it now we can transfer Span text into the outer TextBlock easily. But the properties set in the Span (like FontSize) will be lost, unless we override TextBlock properties with the properties of the first Span found inside the TextBlock.-Inkscape does not put the actual text in the Text property, but uses span instead, which looks like this:
<Span whiteSpaceCollapse="preserve" FontSize="60">Some text here</Span>
Any chance in supporting this?
Do you think this will work for you?
Re: noesisGUI v1.2 BETA 8
It would be great if you can add this fallback. Placing the fonts in the same folder is no problem for me and is a nice compromise to get out of the box functionality.We can interpret FontFamily="Arial" the same as FontFamily="#Arial", but remember that you have to copy the corresponding .ttf fonts next to the xaml file so it can be found.
Yes, that will be great! My text is not fancy anyway and it will surely help to get my project up and running quickly. It will speed up my workflow a lot because it looks like:Full support for inlines is planned after 1.2 release. If you need it now we can transfer Span text into the outer TextBlock easily. But the properties set in the Span (like FontSize) will be lost, unless we override TextBlock properties with the properties of the first Span found inside the TextBlock.
Do you think this will work for you?
Edit file in InkScape -> Export to xaml -> Test in Unity -> Edit file in InkScape -> Export to xaml -> Test in Unity, etc. If I have to open up the exported file and move the text out of the span all the time is a lot of work. I will deal with the FontSize issue later.
Re: noesisGUI v1.2 BETA 8
I noticed that if the rotation center is at the center of the bounding box (default, 0.5,0.5) it is not even added to the xaml file when using Blend, so presumably this is part of the spec. However, if you want to rotate an object from code using NoesisGUI, you have to force the rotation center to be 0.5,0.5 because it defaults to zero. Shouldn't it default to the center instead?
-
sfernandez
Site Admin
- Posts: 3093
- Joined:
Re: noesisGUI v1.2 BETA 8
As stated in WPF documentation, the default value of RenderTransformOrigin property is (0,0), and we followed that description.
In Blend, if you start to transform an element, it automatically adds RenderTransformOrigin="0.5,0.5" to the element because the default value is (0,0). It also adds the typical group of transforms:
In Blend, if you start to transform an element, it automatically adds RenderTransformOrigin="0.5,0.5" to the element because the default value is (0,0). It also adds the typical group of transforms:
Code: Select all
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
Re: noesisGUI v1.2 BETA 8
Please file a bug for this.Thanks!Yes, that will be great! My text is not fancy anyway and it will surely help to get my project up and running quickly.
Who is online
Users browsing this forum: No registered users and 0 guests