コード例 #1
0
ファイル: Render.cs プロジェクト: RikkiRu/Helia_1_5
 public static void loadGUIelements()
 {
     for(int i=0; i<10; i++)
     {
         guiElemnts[i] = new objDrawer(playerView.guiSizeElements, playerView.guiSizeElements, i + 5); //5-14 текстуры... магочисла...
         guiElementsText[i] = new textDrawer(20, changeText("", playerView.countIntGuiText, ContentAlignment.TopRight), Color.Black, Color.Transparent, ContentAlignment.MiddleRight);
     }
 }
コード例 #2
0
ファイル: Render.cs プロジェクト: RikkiRu/Helia_1_5
        public void Resize(int w, int h)
        {
            ortoX = 100;
            ortoY = 100;
            if (h == 0) h = 1;
            float aspect = (float)w / (float)h;
            GL.Viewport(0, 0, w, h);
            GL.MatrixMode(MatrixMode.Projection);
            GL.LoadIdentity();

            if (w < h) { ortoY = ortoY / aspect; }
            else { ortoX = ortoX * aspect; }

            GL.Ortho(0, ortoX, ortoY, 0, -1, 1);

            halfOrtoX = ortoX / 2;
            halfOrtoY = ortoY / 2;

            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadIdentity();

            guiTextHeader = new textDrawer(ortoX, changeText("Добро пожаловать в игру, "+FormGame.username+"!"), Color.Black, Color.Transparent, ContentAlignment.TopLeft);
            guiTextDown = new textDrawer(ortoX, changeText("Оповещения"), Color.White, Color.Black, ContentAlignment.BottomLeft);
            guiTextHeader.x = guiTextDown.x = 0;
            guiTextHeader.y = 0;
            guiTextDown.y = ortoY;

            for(int i=0; i<guiElemnts.Length; i++)
            {
                guiElemnts[i].x = ortoX - playerView.guiSizeElements;
                guiElemnts[i].y = i * playerView.guiSizeElements+playerView.guiSizeElements;

                guiElementsText[i].x = ortoX - playerView.guiSizeElements*2;
                guiElementsText[i].y = i * playerView.guiSizeElements + playerView.guiSizeElements;
            }
        }
コード例 #3
0
ファイル: objDrawer.cs プロジェクト: RikkiRu/Helia_1_5
        public void giveMeName()
        {
            if (type == PlanetType.sun)
            {
                nameOfPlanet = new textDrawer(radius, name, Color.Black, Color.Transparent, ContentAlignment.TopCenter);
                nameOfPlanet.x = ground.x;
                nameOfPlanet.y = ground.y;
            }

            else
            {
                nameOfPlanet = new textDrawer(radius * 2, name, Color.Blue, Color.Transparent, ContentAlignment.TopCenter);
                nameOfPlanet.x = ground.x;
                nameOfPlanet.y = ground.y + radius + 10;
            }
        }