User avatar
Regbalt
Topic Author
Posts: 11
Joined: 21 Feb 2018, 16:13

ScrollViewer Cut Render Problem (Unity)

06 Mar 2018, 18:51

A new Day a new problem :?
Image
The ScrollViewer does not cut correctly, so the inner elments go outside and toggle visibility.
Target: 3D Mesh Render Texture
<UserControl x:Class="Assets.MyResources.UI.TestControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Assets.MyResources.UI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid Background="AliceBlue">
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="Test"></TextBlock>
        <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
            <StackPanel>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
                <Button Content="Test"></Button>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: ScrollViewer Cut Render Problem (Unity)

06 Mar 2018, 19:03

We need a stencil surface to apply masking. Did you create that render target with the option "At least 24 bits depth (with stencil)" ?
 
User avatar
Regbalt
Topic Author
Posts: 11
Joined: 21 Feb 2018, 16:13

Re: ScrollViewer Cut Render Problem (Unity)

06 Mar 2018, 19:13

AAAAAAAAAAAAHHHHHH :shock: It works with with stencil. Thanks :lol:

I always used 0 depth. My thought was that a flat UI does not need a depth buffer.
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: ScrollViewer Cut Render Problem (Unity)

06 Mar 2018, 19:52

I am checking right now, and this is properly documented in the tutorial:

"For masking, NoesisGUI needs an active stencil buffer. This can be activated in Unity by selecting a 24-bits Depth Buffer".

So, closing this! Thanks for your feedback.

Who is online

Users browsing this forum: No registered users and 0 guests