Exemple #1
0
    public static void CreateRenderTexture(ref RenderTexture renderTexture, string name)
    {
        int pixelWidth  = CamerasMgr.CameraMain.get_pixelWidth();
        int pixelHeight = CamerasMgr.CameraMain.get_pixelHeight();

        UIConst.GetRealScreenSize(out pixelWidth, out pixelHeight);
        ShaderEffectUtils.SafeCreateRenderTexture(ref renderTexture, name, 16, 7, 1, pixelWidth, pixelHeight);
    }
Exemple #2
0
    public static int GetRealScreenSizeHeight()
    {
        int num;
        int result;

        UIConst.GetRealScreenSize(out num, out result);
        return(result);
    }
Exemple #3
0
    public static void GetRealScreenScale(out float realScaleScreenWidth, out float realScaleScreenHeight)
    {
        int num;
        int num2;

        UIConst.GetRealScreenSize(out num, out num2);
        realScaleScreenWidth  = (float)num / UIConst.UI_SIZE_WIDTH;
        realScaleScreenHeight = (float)num2 / UIConst.UI_SIZE_HEIGHT;
    }
    private void Start()
    {
        int num;
        int num2;

        UIConst.GetRealScreenSize(out num, out num2);
        RectTransform rectTransform = base.get_transform() as RectTransform;

        if (rectTransform != null)
        {
            rectTransform.set_sizeDelta(new Vector2((float)num, (float)num2));
        }
    }
    private void SetSize()
    {
        int num;
        int num2;

        UIConst.GetRealScreenSize(out num, out num2);
        num  += 20;
        num2 += 20;
        if (this.state == FXMaskLayer.MaskState.SizeXZ)
        {
            base.get_transform().set_localScale(new Vector3((float)num, 1f, (float)num2));
        }
        else if (this.state == FXMaskLayer.MaskState.SizeXY)
        {
            base.get_transform().set_localScale(new Vector3((float)num, (float)num2, 1f));
        }
    }
Exemple #6
0
    public static void GetBound(ref float x, ref float y, float width_targettran, float height_targettran, Vector2 pivot)
    {
        int num;
        int num2;

        UIConst.GetRealScreenSize(out num, out num2);
        if (pivot.x == 0f)
        {
            if (x + width_targettran > (float)(num / 2))
            {
                x = (float)(num / 2) - width_targettran;
            }
            if (x < (float)(-(float)(num / 2)))
            {
                x = (float)(-(float)(num / 2));
            }
        }
        else if (pivot.x == 0.5f)
        {
            if (x + width_targettran / 2f > (float)(num / 2))
            {
                x = (float)(num / 2) - width_targettran / 2f;
            }
            if (x - width_targettran / 2f < (float)(-(float)(num / 2)))
            {
                x = (float)(-(float)(num / 2)) + width_targettran / 2f;
            }
        }
        else if (pivot.x == 1f)
        {
            if (x > (float)(num / 2))
            {
                x = (float)(num / 2);
            }
            if (x - width_targettran < (float)(-(float)(num / 2)))
            {
                x = (float)(-(float)(num / 2)) + width_targettran;
            }
        }
        if (pivot.y == 0f)
        {
            if (y + height_targettran > (float)(num2 / 2))
            {
                y = (float)(num2 / 2) - height_targettran;
            }
            if (y < (float)(-(float)(num2 / 2)))
            {
                y = (float)(-(float)(num2 / 2));
            }
        }
        else if (pivot.y == 0.5f)
        {
            if (y + height_targettran / 2f > (float)(num2 / 2))
            {
                y = (float)(num2 / 2) - height_targettran / 2f;
            }
            if (y - height_targettran / 2f < (float)(-(float)(num2 / 2)))
            {
                y = (float)(-(float)(num2 / 2)) + height_targettran / 2f;
            }
        }
        else if (pivot.y == 1f)
        {
            if (y > (float)(num2 / 2))
            {
                y = (float)(num2 / 2);
            }
            if (y - height_targettran < (float)(-(float)(num2 / 2)))
            {
                y = (float)(-(float)(num2 / 2)) + height_targettran;
            }
        }
    }