Esempio n. 1
0
        /// <summary>
        /// Creates a new stat bar for the GUI.
        /// </summary>
        /// <param name="capi">The client API</param>
        /// <param name="bounds">The bounds of the stat bar.</param>
        /// <param name="color">The color of the stat bar.</param>
        /// <param name="rightToLeft">Determines the direction that the bar fills.</param>
        public GuiElementStatbar(ICoreClientAPI capi, ElementBounds bounds, double[] color, bool rightToLeft) : base(capi, "", CairoFont.WhiteDetailText(), bounds)
        {
            barTexture   = new LoadedTexture(capi);
            flashTexture = new LoadedTexture(capi);
            valueTexture = new LoadedTexture(capi);

            this.color       = color;
            this.rightToLeft = rightToLeft;

            onGetStatbarValue = () => { return((float)Math.Round((float)value, 1) + " / " + (int)this.maxValue); };
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new stat bar for the GUI.
        /// </summary>
        /// <param name="capi">The client API</param>
        /// <param name="bounds">The bounds of the stat bar.</param>
        /// <param name="color">The color of the stat bar.</param>
        /// <param name="rightToLeft">Determines the direction that the bar fills.</param>
        public GuiElementStatbar(ICoreClientAPI capi, ElementBounds bounds, double[] color, bool rightToLeft) : base(capi, "", CairoFont.WhiteDetailText(), bounds)
        {
            barTexture   = new LoadedTexture(capi);
            flashTexture = new LoadedTexture(capi);
            valueTexture = new LoadedTexture(capi);

            this.color       = color;
            this.rightToLeft = rightToLeft;
            //value = new Random(Guid.NewGuid().GetHashCode()).Next(100);

            onGetStatbarValue = () => { return((int)value + " / " + (int)this.maxValue); };
        }