zoukankan      html  css  js  c++  java
  • Unity3d GUI适应分辨率

    float sourceWidth = 1024f;
        float sourceHeight = 768f;
        float m_fScaleWidth;
        float m_fScaleHeight;
    
        void OnGUI()
        {
            m_fScaleWidth = Screen.width / sourceWidth;
            m_fScaleHeight = Screen.height / sourceHeight;
            GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity,new Vector3(m_fScaleWidth, m_fScaleHeight, 1));
    
            GUI.Button(new Rect(0, 0, 1024, 768), "");
        }

查看全文
  • 相关阅读:
    hdu 2492 树状数组 Ping pong
    HDU 1532 基础EK Drainage Ditches
    EK算法模板
    Codeforces Round #538 (Div. 2) (A-E题解)
    Codeforces Global Round 1 (A-E题解)
    Educational Codeforces Round 59 (Rated for Div. 2) DE题解
    Codeforces Round #535 (Div. 3) 题解
    Codeforces Round #534 (Div. 2) D. Game with modulo(取余性质+二分)
    POJ2253:Frogger(改造Dijkstra)
    POJ1797:Heavy Transportation(改造Dijkstra)
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10713104.html
  • Copyright © 2011-2022 走看看