コード例 #1
0
ファイル: LAppView.cs プロジェクト: Astoration/StarSeeker
    public void SetupView(float width, float height)
    {
        float left  = LAppDefine.VIEW_LOGICAL_LEFT;
        float right = LAppDefine.VIEW_LOGICAL_RIGHT;

        float screenW = Math.Abs(left - right);

        deviceToScreen.identity();
        deviceToScreen.multTranslate(-width / 2.0f, height / 2.0f);
        deviceToScreen.multScale(screenW / width, screenW / width);

        canvasWidth  = width;
        canvasHeight = height;
    }
コード例 #2
0
    public void setupView(float width, float height)
    {
        float ratio  = height / width;
        float left   = LAppDefine.VIEW_LOGICAL_LEFT;
        float right  = LAppDefine.VIEW_LOGICAL_RIGHT;
        float bottom = -ratio;
        float top    = ratio;

        viewMatrix.setScreenRect(left, right, bottom, top);

        float screenW = Math.Abs(left - right);

        deviceToScreen.identity();
        deviceToScreen.multTranslate(-width / 2.0f, height / 2.0f);
        deviceToScreen.multScale(screenW / width, screenW / width);

        canvasWidth  = width;
        canvasHeight = height;
    }