Exemplo n.º 1
0
        public void SetPlaceHolderText(string text)
        {
            TextTextureUtil util = new TextTextureUtil(this.api);

            placeHolderTextTexture?.Dispose();
            CairoFont font = Font.Clone();

            font.Color[3]         *= 0.5;
            placeHolderTextTexture = util.GenTextTexture(text, font);
        }
Exemplo n.º 2
0
        public override void RenderTo(ICoreClientAPI capi, double x, double y)
        {
            float size = (float)GuiElement.scaled(25);
            float pad  = (float)GuiElement.scaled(10);

            int index = (int)((capi.ElapsedMilliseconds / 1000) % Stacks.Count);

            dummySlot.Itemstack = Stacks[index];
            capi.Render.RenderItemstackToGui(dummySlot, x + pad + size / 2, y + size / 2, 100, size, ColorUtil.WhiteArgb, true, false, false);

            if (Texture == null)
            {
                Texture = new TextTextureUtil(capi).GenTextTexture(Name, CairoFont.WhiteSmallText());
            }

            capi.Render.Render2DTexturePremultipliedAlpha(
                Texture.TextureId,
                (x + size + GuiElement.scaled(25)),
                y + size / 4 - 3,
                Texture.Width,
                Texture.Height,
                50
                );
        }