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 SetScale()
    {
        float num;
        float num2;

        UIConst.GetRealScreenScale(out num, out num2);
        if (this.state == FXMaskLayer.MaskState.ScaleXY)
        {
            base.get_transform().set_localScale(new Vector3(num, num2, 1f));
        }
    }
    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 #7
0
    protected override void InitUI()
    {
        base.InitUI();
        this.mFlagSelf     = (base.FindTransform("FlagSelf") as RectTransform);
        this.mFlagPoint    = (base.FindTransform("FlagPoint") as RectTransform);
        this.m_spFlagPoint = base.FindTransform("FlagPoint").GetComponent <Image>();
        this.m_texRadarMap = base.FindTransform("RadarMap").GetComponent <RawImage>();
        this.m_texRadarMap.get_rectTransform().set_sizeDelta(RadarManager.size_mapImage_minmap);
        this.m_spName = base.FindTransform("Name").GetComponent <Image>();
        RectTransform rectTransform = base.FindTransform("RadarMapBG") as RectTransform;

        rectTransform.set_sizeDelta(new Vector2(rectTransform.get_sizeDelta().x, (float)UIConst.GetRealScreenSizeHeight() - 75f));
    }
Exemple #8
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;
            }
        }
    }