Khonan
Topic Author
Posts: 24
Joined: 23 Jan 2019, 10:18

HUD Rendering

23 Jan 2019, 23:48

Hi,

I'm working on some kind of HUD but as soon as I attach a noesisview to my cam, noesis fill the entire screen (and not only the controls from the xaml file). How to make the xaml "root" transparent... Where is defined the background color ? ( I could set the alpha to 0, at least :))

If someone got an idea ;)

Regards,
 
Khonan
Topic Author
Posts: 24
Joined: 23 Jan 2019, 10:18

Re: HUD Rendering

24 Jan 2019, 09:11

I'll add this to my log:

It appears I was using noesistheme.xaml (for testing theming styles) and noesistheme makes the background opaque.
As soon as I removed Style or using another one (like NocturnalStyle.xaml) I get back my 3d view behind the HUD :

ResourceDictionary style = (ResourceDictionary)Noesis.GUI.LoadXaml("Assets/NoesisGUI/Samples/test/NocturnalStyle.xaml");
Noesis.GUI.SetApplicationResources(style);
Noesis.GUI.LoadComponent(this, "Assets/NoesisGUI/Samples/test/MainWindow.xaml");

Let's move on.

(XAML code in unity is really great ! Thanks to the team)
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: HUD Rendering

24 Jan 2019, 11:03

NoesisTheme makes the background opaque
I'm curious, what kind of control were you using as root of your xaml?
Because base controls like Control, ContentControl, UserControl, ItemsControl... all have a null background and shouldn't fill the screen.
And Panel classes like Grid, Canvas, DockPanel,... that are normally used as root have also a null background as default.
 
Khonan
Topic Author
Posts: 24
Joined: 23 Jan 2019, 10:18

Re: HUD Rendering

31 Jan 2019, 11:22

I was using a UserControl,

<UserControl x:Class="Atome2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/marku ... ility/2006" mc:Ignorable="d"
xmlns:local="clr-namespace:Atome2"
Background="#FF1A1A1D" Height="Auto" d:DesignWidth="1000" VerticalAlignment="Top">

<Grid Height="Auto" HorizontalAlignment="Stretch">
...
</Grid>

----
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: HUD Rendering

31 Jan 2019, 13:49

Ok, makes sense now, you were setting the Background of the root control.
Background="#FF1A1A1D"

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 21 guests