Exemplo n.º 1
0
    // Token: 0x06004DC2 RID: 19906 RVA: 0x00135684 File Offset: 0x00133884
    public override void OnFill(NGUI.Meshing.MeshBuffer m)
    {
        if (this.mFont == null)
        {
            return;
        }
        Color normalColor = (!this.mInvisibleHack) ? base.color : Color.clear;

        this.MakePositionPerfect();
        global::UIWidget.Pivot pivot = base.pivot;
        int vSize = m.vSize;

        if (pivot == global::UIWidget.Pivot.Left || pivot == global::UIWidget.Pivot.TopLeft || pivot == global::UIWidget.Pivot.BottomLeft)
        {
            if (this.mOverflowRight)
            {
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.LeftOverflowRight, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
            }
            else
            {
                this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Left, 0, ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
            }
        }
        else if (pivot == global::UIWidget.Pivot.Right || pivot == global::UIWidget.Pivot.TopRight || pivot == global::UIWidget.Pivot.BottomRight)
        {
            this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Right, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
        }
        else
        {
            this.mFont.Print(this.processedText, normalColor, m, this.mEncoding, this.mSymbols, global::UIFont.Alignment.Center, Mathf.RoundToInt(this.relativeSize.x * (float)this.mFont.size), ref this.mSelection, this.mCarratChar, this.mHighlightTextColor, this.mHighlightColor, this.mHighlightChar, this.mHighlightCharSplit);
        }
        m.ApplyEffect(base.cachedTransform, vSize, this.effectStyle, this.effectColor, (float)this.mFont.size);
    }
    // Token: 0x06004B90 RID: 19344 RVA: 0x001272C0 File Offset: 0x001254C0
    protected static Vector2 DefaultPivot(global::UIWidget.Pivot pivot)
    {
        Vector2 result;

        switch (pivot)
        {
        case global::UIWidget.Pivot.TopLeft:
            result.x = 0f;
            result.y = 0f;
            break;

        case global::UIWidget.Pivot.Top:
            result.y = -0.5f;
            result.x = -1f;
            break;

        case global::UIWidget.Pivot.TopRight:
            result.y = 0f;
            result.x = -1f;
            break;

        case global::UIWidget.Pivot.Left:
            result.x = 0f;
            result.y = 0.5f;
            break;

        case global::UIWidget.Pivot.Center:
            result.x = -0.5f;
            result.y = 0.5f;
            break;

        case global::UIWidget.Pivot.Right:
            result.x = -1f;
            result.y = 0.5f;
            break;

        case global::UIWidget.Pivot.BottomLeft:
            result.x = 0f;
            result.y = 1f;
            break;

        case global::UIWidget.Pivot.Bottom:
            result.x = -0.5f;
            result.y = 1f;
            break;

        case global::UIWidget.Pivot.BottomRight:
            result.x = -1f;
            result.y = 1f;
            break;

        default:
            throw new NotImplementedException();
        }
        return(result);
    }
Exemplo n.º 3
0
        static StackObject *set_pivot_7(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UIWidget.Pivot @value = (global::UIWidget.Pivot) typeof(global::UIWidget.Pivot).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UIWidget instance_of_this_method = (global::UIWidget)typeof(global::UIWidget).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.pivot = value;

            return(__ret);
        }