Page 1 of 1
How to make a simple Scroll Box for text?
Posted: 10 Sep 2017, 01:49
by dilljone
Hi there. Still very new to Ventuz. Hopefully this is a simple request. Essentially I'm trying to make a simple scroll box for text. What would be the proper way to do this in Ventuz?
Re: How to make a simple Scroll Box for text?
Posted: 12 Sep 2017, 10:59
by stephen
Hi dilljone,
The scrollbox has two main problems:
1. Text must be occluded outside the box
2. Text must be movable
1. can be solved by using the Stencil Set and Stencil Test Nodes (hover over them with the Mouse and press F1 to open a dropdown which holds an example scene of the Stencil Nodes).
2. can be solved with a Touch Translation Node in front of the Text - the user can then drag the text upwards which is probably rather intuitive enough. You can also limit the maximum Translation that the user can apply this way. X Translation should be limited to exactly 0. Y Translation should be limited to 0 and the Y Size of the Text (you can get it from the Block Text Node) minus the size of the Scroll Box.
You could also create a slider for a scrollbar on the side but the logic is very similar - note that the Touch Translation Outputs the current X and Y Positions which you can use to reposition the text.
Hope this gets you started!
Stephen