Exemple #1
0
 public override void Render(double delta)
 {
     if (texture.IsValid)
     {
         texture.Render(graphicsApi);
     }
 }
        public override void Render(double delta)
        {
            if (!texture.IsValid)
            {
                return;
            }
            Texture backTex = Active ? selectedTex : shadowTex;

            if (Disabled)
            {
                backTex = disabledTex;
            }

            backTex.ID    = game.UseClassicGui ? game.GuiClassicTexId : game.GuiTexId;
            backTex.X1    = X; backTex.Y1 = Y;
            backTex.Width = Width; backTex.Height = Height;

            backTex.Render(graphicsApi);
            FastColour col = Active ? FastColour.White : new FastColour(200, 200, 200);

            if (Disabled)
            {
                col = new FastColour(150, 150, 150);
            }
            texture.Render(graphicsApi, col);
        }
Exemple #3
0
        public override void Render(double delta)
        {
            status.Render(delta);
            bottomRight.Render(delta);

            UpdateChatYOffset(false);
            DateTime now = DateTime.UtcNow;

            if (HandlesAllInput)
            {
                normalChat.Render(delta);
            }
            else
            {
                RenderRecentChat(now, delta);
            }

            if (announcementTex.IsValid)
            {
                announcementTex.Render(graphicsApi);
            }
            if (HandlesAllInput)
            {
                textInput.Render(delta);
            }

            if (game.Chat.Announcement.Text != null && announcementTex.IsValid &&
                (now - game.Chat.Announcement.Received).TotalSeconds > 5)
            {
                graphicsApi.DeleteTexture(ref announcementTex);
            }
        }
Exemple #4
0
        public override void Render(double delta)
        {
            graphicsApi.Texturing = false;
            int y = Y, x = X;

            for (int i = 0; i < sizes.Length; i++)
            {
                bool caretAtEnd = caretTex.Y1 == y && (indexX == 64 || caretPos == -1);
                int  offset     = caretAtEnd ? defaultWidth : 0;
                graphicsApi.Draw2DQuad(x + 5, y, sizes[i].Width + offset, sizes[i].Height, backColour);
                y += sizes[i].Height;
            }
            if (sizes.Length == 0 || sizes[0] == Size.Empty)
            {
                graphicsApi.Draw2DQuad(x + 5, y, defaultWidth, defaultHeight, backColour);
            }
            graphicsApi.Texturing = true;

            inputTex.Render(graphicsApi);
            caretTex.Render(graphicsApi, caretCol);
            if (altText.Active)
            {
                altText.Render(delta);
            }
        }
Exemple #5
0
 public override void Render(double delta)
 {
     chatInputTexture.Render(graphicsApi);
     if ((accumulator % 1) >= 0.5 && Active)
     {
         chatCaretTexture.Render(graphicsApi);
     }
     accumulator += delta;
 }
 public override void Render(double delta)
 {
     chatInputTexture.Render(graphicsApi);
     //if( (accumulator % 1) < 0.5 && Active ) {
     //	chatCaretTexture.Y1 = chatInputTexture.Y1 + yOffset;
     //	chatCaretTexture.Render( graphicsApi );
     //}
     accumulator += delta;
 }
Exemple #7
0
 public override void Render(double delta)
 {
     graphicsApi.ClearColour(FastColour.Black);
     graphicsApi.Texturing = true;
     titleWidget.Render(delta);
     messageWidget.Render(delta);
     progressBoxTexture.Render(graphicsApi);
     graphicsApi.Texturing = false;
     graphicsApi.Draw2DQuad(progX, progY, progWidth * progress / 100f, progHeight, FastColour.White);
 }
 public override void Render(double delta)
 {
     for (int i = 0; i < Textures.Length; i++)
     {
         Texture texture = Textures[i];
         if (texture.IsValid)
         {
             texture.Render(graphicsApi);
         }
     }
 }
 public override void Render(double delta)
 {
     graphicsApi.Texturing = false;
     graphicsApi.Draw2DQuad(X, Y, Width, Height, tableCol);
     graphicsApi.Texturing = true;
     for (int i = 0; i < namesCount; i++)
     {
         Texture texture = textures[i];
         if (texture.IsValid)
         {
             texture.Render(graphicsApi);
         }
     }
 }
        void RenderHotbar()
        {
            int texId = game.UseClassicGui ? game.GuiClassicTexId : game.GuiTexId;

            backTex.ID = texId;
            backTex.Render(graphicsApi);

            int i = game.Inventory.HeldBlockIndex;
            int x = (int)(X + barXOffset + (elemSize + borderSize) * i + elemSize / 2);

            selTex.ID = texId;
            selTex.X1 = (int)(x - selBlockSize / 2);
            selTex.Render(graphicsApi);
        }
Exemple #11
0
        void RenderClientStatus()
        {
            int y = clientStatus.Y + clientStatus.Height;

            for (int i = 0; i < clientStatus.Textures.Length; i++)
            {
                Texture texture = clientStatus.Textures[i];
                if (!texture.IsValid)
                {
                    continue;
                }

                y         -= texture.Height;
                texture.Y1 = y;
                texture.Render(graphicsApi);
            }
        }
Exemple #12
0
        void RenderRecentChat(DateTime now, double delta)
        {
            int[] metadata = (int[])Metadata;
            for (int i = 0; i < normalChat.Textures.Length; i++)
            {
                Texture texture = normalChat.Textures[i];
                if (!texture.IsValid)
                {
                    continue;
                }

                DateTime received = game.Chat.Log[metadata[i]].Received;
                if ((now - received).TotalSeconds <= 10)
                {
                    texture.Render(graphicsApi);
                }
            }
        }
Exemple #13
0
        public override void Render(double delta)
        {
            graphicsApi.Draw2DQuad(TableX, TableY, TableWidth, TableHeight, backCol);
            if (rows > maxRows)
            {
                DrawScrollbar();
            }
            graphicsApi.Texturing = true;
            graphicsApi.SetBatchFormat(VertexFormat.Pos3fTex2fCol4b);

            IsometricBlockDrawer.lastTexId = -1;
            for (int i = 0; i < blocksTable.Length; i++)
            {
                int x, y;
                if (!GetCoords(i, out x, out y))
                {
                    continue;
                }

                // We want to always draw the selected block on top of others
                if (i == selIndex)
                {
                    continue;
                }
                IsometricBlockDrawer.Draw(game, (byte)blocksTable[i], blockSize * 0.7f / 2f,
                                          x + blockSize / 2, y + blockSize / 2);
            }

            if (selIndex != -1)
            {
                int x, y;
                GetCoords(selIndex, out x, out y);
                IsometricBlockDrawer.lastTexId = -1;
                IsometricBlockDrawer.Draw(game, (byte)blocksTable[selIndex], (blockSize + selBlockExpand) * 0.7f / 2,
                                          x + blockSize / 2, y + blockSize / 2);
            }

            if (blockInfoTexture.IsValid)
            {
                blockInfoTexture.Render(graphicsApi);
            }
            game.hudScreen.RenderHotbar(delta);
            graphicsApi.Texturing = false;
        }
        public override void Render(double delta)
        {
            graphicsApi.Texturing = false;
            int offset = overview.Height;
            int height = namesPerColumn * (elemHeight + 1) + boundsSize * 2 + offset;

            graphicsApi.Draw2DQuad(X, Y - offset, Width, height, lightTableCol);

            graphicsApi.Texturing = true;
            overview.MoveTo(game.Width / 2 - overview.Width / 2,
                            Y - offset + boundsSize / 2);
            overview.Render(delta);

            for (int i = 0; i < namesCount; i++)
            {
                Texture texture = textures[i];
                if (texture.IsValid)
                {
                    texture.Render(graphicsApi);
                }
            }
        }
Exemple #15
0
 public override void Render(double delta)
 {
     texture.Render(graphicsApi);
 }