Ejemplo n.º 1
0
        float GetPreferredHeight(ILayoutElement itemLayoutElement, ItemDataType data)
        {
            itemTemplate.SetData(data);
            itemLayoutElement.CalculateLayoutInputVertical();

            return(itemLayoutElement.preferredHeight);
        }
Ejemplo n.º 2
0
        protected virtual float GetMaxTabTextWidth()
        {
            float longestTextWidth = 0;

            if (m_TabItemTemplate.graphic != null)
            {
                var changed      = false;
                var originalText = m_TabItemTemplate.graphic.GetGraphicText();
                for (int i = 0; i < m_Pages.Count; i++)
                {
                    ILayoutElement layoutElement = m_TabItemTemplate.graphic as ILayoutElement;
                    if (layoutElement != null)
                    {
                        changed = true;
                        m_TabItemTemplate.graphic.SetGraphicText(m_Pages[i].tabName);
                        layoutElement.CalculateLayoutInputHorizontal();
                        layoutElement.CalculateLayoutInputVertical();
                        longestTextWidth = Mathf.Max(longestTextWidth, layoutElement.preferredWidth);
                    }
                }
                if (changed)
                {
                    m_TabItemTemplate.graphic.SetGraphicText(originalText);
                }
            }

            return(longestTextWidth);
        }
Ejemplo n.º 3
0
    public static int CalculateLayoutInputVertical(IntPtr l)
    {
        int result;

        try
        {
            ILayoutElement layoutElement = (ILayoutElement)LuaObject.checkSelf(l);
            layoutElement.CalculateLayoutInputVertical();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Ejemplo n.º 4
0
 public void CalculateLayoutInputVertical()
 {
     m_redirectedLayoutElement.CalculateLayoutInputVertical();
 }