Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Chaosgod_Espér on January 29, 2015, 03:10:24 AM

Title: [Editor] How to call the Selectors?
Post by: Chaosgod_Espér on January 29, 2015, 03:10:24 AM
hi there..

I wanted to know how to call the Atlas Selection window and a Sprite Selector.
I know theres DrawSpriteField, but no documentation about, how to use that, how to write a callback or how to create the atlas selection..

Can someone explain this Editor stuff?
Title: Re: [Editor] How to call the Selectors?
Post by: ArenMook on January 29, 2015, 01:10:24 PM
What documentation are you expecting? The functions themselves do have a comment above them and all they do is what the function's title suggests: they draw a sprite field. Not sure why you need this to be honest? Most of editor related code was not meant to be used by others.

If you just do a reference search on DrawSpriteField, you will find quite a few places where it's used. UICreateWidgetWizard for example:
  1. NGUIEditorTools.DrawSpriteField("Sprite", "Sprite that will be created", NGUISettings.atlas, NGUISettings.selectedSprite, OnSprite, GUILayout.Width(120f));
OnSprite is the callback function that gets called when the sprite gets selected.