Two Issues with Noesis GUI - Blocking OnMouseDown Events and Image Binding
Posted: 30 Sep 2024, 06:12
Hi,
I would like to report two issues I encountered while using Noesis GUI with Unity.
Issue 1: <Path> with IsHitTestVisible="False" blocks OnMouseDown events in Unity
Problem Description:
I have a world-space UI displayed above buildings. Some elements, like <Path>, are used for design purposes and are set to IsHitTestVisible="False".
I expect that when IsHitTestVisible="False" is set, events should be passed through to the 3D elements (buildings) underneath the UI. However, this is not the case. Despite the element being set as non-interactive, it still blocks the OnMouseDown event in Unity.
I used VisualTreeHelper.HitTest to verify if the UI elements were consuming the click events, and it shows that the <Path> element consumes the clicks even though IsHitTestVisible="False" is set.
Test Code:
Expected Behavior:
I expect that when IsHitTestVisible="False" is set on a <Path> element, all click events are passed through to the underlying 3D elements (like buildings).
Issue 2: Image Binding Issue
Problem Description:
When using an <Image> element with a static image source, the image displays correctly. For example, the following code works as expected:
However, when I try to bind the image source using an Icon property (Binding), the image does not display, even though the bound value for Icon is exactly the same as the static path. Here is the code that does not work:
The image is not found when using the binding, despite the value being correct..
Interestingly, if I place both the static image and the bound image together in the XAML, both images display correctly. This suggests that the binding itself is valid, but there might be an issue with loading the image solely through binding.
Expected Behavior:
I expect that binding the image source using {Binding Icon} should load and display the image independently, just like when providing a static path.
thank you .
I would like to report two issues I encountered while using Noesis GUI with Unity.
Issue 1: <Path> with IsHitTestVisible="False" blocks OnMouseDown events in Unity
Problem Description:
I have a world-space UI displayed above buildings. Some elements, like <Path>, are used for design purposes and are set to IsHitTestVisible="False".
I expect that when IsHitTestVisible="False" is set, events should be passed through to the 3D elements (buildings) underneath the UI. However, this is not the case. Despite the element being set as non-interactive, it still blocks the OnMouseDown event in Unity.
I used VisualTreeHelper.HitTest to verify if the UI elements were consuming the click events, and it shows that the <Path> element consumes the clicks even though IsHitTestVisible="False" is set.
Test Code:
Code: Select all
<Path Stroke="#90000009" StrokeThickness="30" Fill="Transparent" IsHitTestVisible="False" Data="{Binding BackgroundGeometry}" />
Code: Select all
VisualTreeHelper.HitTest Output:
[World-Space UI] Mouse is over a UI element: Noesis.Path
Physics.Raycast Output
[Unity Raycast] Building clicked!
OnMouseDown() not called
I expect that when IsHitTestVisible="False" is set on a <Path> element, all click events are passed through to the underlying 3D elements (like buildings).
Issue 2: Image Binding Issue
Problem Description:
When using an <Image> element with a static image source, the image displays correctly. For example, the following code works as expected:
Code: Select all
<Image Source="/Assets/View/GamePlay/build-all.png"
Width="20" Height="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="0.7"/>
Code: Select all
<Image Source="{Binding Icon}"
Width="20" Height="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="0.7"/>
Code: Select all
[NOESIS] Image not found '/Assets/View/GamePlay/build-all.png'
Interestingly, if I place both the static image and the bound image together in the XAML, both images display correctly. This suggests that the binding itself is valid, but there might be an issue with loading the image solely through binding.
Code: Select all
<Image Source="/Assets/View/GamePlay/build-all.png"
Width="20" Height="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="0.7"/>
<Image Source="{Binding Icon}"
Width="20" Height="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="0.7"/>
I expect that binding the image source using {Binding Icon} should load and display the image independently, just like when providing a static path.
thank you .