Search Unity

Question IntegerField in UI Builder?

Discussion in 'UI Toolkit' started by Fritsl, Aug 13, 2020.

  1. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    How would I add an
    IntegerField
    ?

    (I can see things like Text field, but how would I add an IntegerField in the visual UI Builder, to have it written to the UXML?)
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    IntegerField is only available when building UI for Editor extensions. It cannot be used for runtime UI at the moment. The UI Builder has been set for runtime UI Authoring by default, which is why it does not show you controls like the IntegerField in the Library by default.

    If you are building UI for the Editor, you can enable Editor Extension Authoring by selecting the main document (click on the Canvas header in the Viewport), and changing this in the Inspector:
    upload_2020-8-13_14-41-34.png
     
  3. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    waaaaaooooo!!! The headache I had!!
    Thanks a lot. I think you might want to highlight that a lot.. Like greyed out / tool tip in the Library.
    Thanks!
     
  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Ya...it's a balancing act. We don't want to annoy or confuse users building UI for runtime only with Editor-only controls (most of which will actively not work at runtime), while making it somewhat easily discoverable for Editor UI users.

    There's also a quick toggle in the ... menu of the Library pane itself for enabling/disabling Editor Extension Authoring.
     
  5. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    Oh thanks.
    As a feedback, I do believe that you want to somehow explicit explain this.

    A tool that is "half the tool unless something is clicked somewhere" is frustrating when you come blank from the outside -> my guess is that this will hit people over and again, so a simple startup selection such as "[Build Editor Tool or Build Game UI?]" choice would in a simple manner force this knowledge upon new users, with an absolutely minimum of pain for experienced users, actually more like a service for them as well ;)
     
    baerbel likes this.