Page 1 of 1

Scaling of Textbox Caret

Posted: 25 Feb 2014, 13:21
by Andreas Schooll
Hi guys,

we have the following situation. Our unity noesis application main window is made with a wrapping viewbox that contains all other ui elements. The viewbox scales with the window resolution (in a pc standalone app), so all contained elements scale accordingly.

Now to the problem:
The textbox caret (input cursor) seems to be 1 pixel wide. This width does not scale with the viewbox, i.e. if you make the viewbox very large it still stays at 1 pixel width. This would not be a problem but the problem occurs on downscaling. The textbox caret will not be visible on certain display positions (i.e. x-positions). If you input a text, it appears and disappears depending on the width of the inputed characters,

Is there a way to fix this?
I looked into the internet and found some tutorials on how to customize the textbox caret. But it seems to be a lot of effort to achieve this for such a simple thing :) ... PF-TextBox

Is it possible to manipulate / align the position of the caret? Can you suggest an approach?

best regards,

Re: Scaling of Textbox Caret

Posted: 25 Feb 2014, 15:00
by sfernandez

I just tested a TextBox placed inside a ViewBox and the Caret scales accordingly. When TextBox scales up, caret rectangle width scales up (it is not limited to 1 pixel width), and when TextBox scales down, caret rectangle width scales down (even below 1 pixel).

I think the problem is that you are no using any MSAA, so lines smaller than 1 pixel that don't fall around pixel center are not drawn. I was able to reproduce it that way.

If you cannot use MSAA, activate PPAA in the NoesisGUIPanel component to avoid this problem.

Re: Scaling of Textbox Caret

Posted: 26 Feb 2014, 15:14
by Andreas Schooll

please take a look at the attached picture.

In the lower part of the picture there is a textbox which gets (for testing purposes) extremly scaled up. Still the caret appears only in size of 1 pixel.

Did you make any changes recently that could have affected this behaviour? We are currently using Noesis 1.1.4

Our multisampling settings are:
Unity Project settings / Quality: 8x Multi Sampling
Noesis GUIPanel: Antialiasing: MSAA; Quality: High

best regards,

Re: Scaling of Textbox Caret

Posted: 26 Feb 2014, 15:19
by jsantos
Are you sure that the screenshot is correct? There is no antialiasing in that capture.

Re: Scaling of Textbox Caret

Posted: 26 Feb 2014, 16:48
by sfernandez
When you select MSAA in our NoesisGUIPanel component, this only means that we rely on MSAA level selected in Unity Quality settings.

You can change Unity's MSAA level by opening 'Edit > Project Settings > Quality' inspector. Under the 'Rendering' section, there is an entry named 'Anti Aliasing'. By default (Good level) anti-aliasing is disabled.

Please select '8x Multi Sampling' in Unity quality settings or select PPAA in our NoesisGUIPanel component, and let us know if Caret rectangle still measures 1 pixel width.

Re: Scaling of Textbox Caret

Posted: 27 Feb 2014, 08:59
by Andreas Schooll
I made some more tests regarding the antialiasing settings.

As i wrote before the unity quality settings for the screenshot is "8 x multisampling" and the NoesisGuiPanel is set to "MSAA". However, if i turn of multisampling in unity quality settings this will not make a difference on the displayed result on my development machnine. We will check it on other machines to see if there is any difference using this setting.

If i turn on PPAA on NoesisGuiPanel the displayed result will look completely different. Antialiasing is turned on and the textbox caret will be visible on all positions.

Do you recommend to use PPAA?

Re: Scaling of Textbox Caret

Posted: 28 Feb 2014, 10:38
by sfernandez
PPAA technique has improved a lot in the last versions but isn't finished yet (we generate some glitches when geometries are scaled by animation, but with static interfaces it shouldn't be a problem to use PPAA).

In a near future we want PPAA to be the default anti-aliasing solution because it's a lot faster and with results very similar to MSAA.