Beispiel #1
0
    public ProcessInputDelegate OnProcessInput;     //unhandled touch events will be sended to this delegate

    // Use this for initialization
    void Start()
    {
        m_Widget = GetComponent <GUIBase_Widget>();

        int callbackMask = (int)E_CallbackType.E_CT_ON_TOUCH_END;

        m_Widget.RegisterCallback(this, callbackMask);
        m_Widget.RegisterUpdateDelegate(UpdateList);

        if (m_FirstListLine != null && m_NumOfLines > 1)
        {
            InitializeChilds();
        }

        if (m_Scrollbar != null)
        {
            m_Scrollbar.ParentWidget = this;
            m_Scrollbar.MaxVisible   = m_NumOfLines;
        }

        if (m_ButtonUp != null)
        {
            m_ButtonUp.Widget.m_VisibleOnLayoutShow = false;
            m_ButtonUp.m_ParentWidget = this;
        }

        if (m_ButtonDown != null)
        {
            m_ButtonDown.Widget.m_VisibleOnLayoutShow = false;
            m_ButtonDown.m_ParentWidget = this;
        }
    }
Beispiel #2
0
    public void Start()
    {
        int flags = (int)E_CallbackType.E_CT_INIT
                    + (int)E_CallbackType.E_CT_SHOW;

        m_Widget.RegisterCallback(this, flags);
    }
Beispiel #3
0
    //---------------------------------------------------------

    // ==================================================================================================
    // === Default MoneBehaviour interface ==============================================================

    #region MoneBehaviourInterface

    public void Start()
    {
        m_Widget = GetComponent <GUIBase_Widget>();
        m_Widget.m_TextScaleFix_HACK = true;
        m_Widget.RegisterUpdateDelegate(RegenerateSprites);
        m_Widget.RegisterCallback(this, (int)E_CallbackType.E_CT_INIT);

        m_TextDyn         = null;
        m_TextIDGenerated = 0;
#if UNITY_EDITOR
        m_TextGenerated      = "";
        m_AnchorPointGen     = -1;
        m_AlignmentGen       = -1;
        m_LineSpaceGenerated = 0.0f;
#endif
        SetRegenerationNeeded();

        if (m_TextID != 0)
        {
            m_TextDyn = m_AllowMultiline == true ? TextDatabase.instance[m_TextID] : TextDatabase.instance[m_TextID].Replace("\n", " ");
            if (m_TextDyn == "<UNKNOWN TEXT>")
            {
                Debug.Log("Invalid text id on label: " + gameObject.GetFullName());
            }
        }
        else if (string.IsNullOrEmpty(m_Text) == false && m_AllowMultiline == false)
        {
            m_Text = m_Text.Replace("\n", " ");
        }
    }
Beispiel #4
0
    //---------------------------------------------------------
    public void Start()
    {
        m_Widget = GetComponent <GUIBase_Widget>();

        int flags = (int)E_CallbackType.E_CT_INIT;

        m_Widget.RegisterCallback(this, flags);
    }
Beispiel #5
0
    //---------------------------------------------------------
    void Start()
    {
        int flags = (int)E_CallbackType.E_CT_INIT + (int)E_CallbackType.E_CT_ON_TOUCH_BEGIN;

        m_Widget.RegisterCallback(this, flags);

        RefreshComponents();
    }
Beispiel #6
0
    //---------------------------------------------------------
    public void Start()
    {
        int flags = (int)E_CallbackType.E_CT_SHOW + (int)E_CallbackType.E_CT_HIDE;

        m_Widget.RegisterCallback(this, flags);
        SetValue(m_InitValue);

        RefreshComponents();
    }
Beispiel #7
0
    void Start()
    {
        // register callbacks
        int callbackMask = (int)E_CallbackType.E_CT_INIT
                           + (int)E_CallbackType.E_CT_SHOW;

        m_Widget.RegisterCallback(this, callbackMask);

        // done
        m_IsDirty = true;
    }
Beispiel #8
0
    // ==================================================================================================
    // === Default MoneBehaviour interface ==============================================================

    #region MoneBehaviourInterface

    public void Start()
    {
        m_Widget = GetComponent <GUIBase_Widget>();
        m_Widget.RegisterUpdateDelegate(RegenerateSprites);
        m_Widget.RegisterCallback(this, (int)E_CallbackType.E_CT_INIT);
        m_Widget.m_TextScaleFix_HACK = true;

        if (m_TextID <= 0 && string.IsNullOrEmpty(m_Text))
        {
            m_Text = "This-is-temporary-test-for-testing-TextArea-auto-wrap. This is tooooooo long line. \n\n"
                     + "This is temporary test for testing TextArea auto wrap. This is tooooooo long line. "
                     + "This is temporary test for testing TextArea auto wrap. This is tooooooo long line.";

            //m_Text	=  "Test";
        }

        if (m_Font == null)
        {
            //m_Font = MFGuiManager.Instance.GetFontForLanguage(SystemLanguage.English);
            m_Font = MFFontManager.GetFont(m_FontName) as GUIBase_FontEx;
        }

        SetRegenerationNeeded();
    }