Ejemplo n.º 1
0
            public override bool Draw(Batcher2D batcher, int x, int y)
            {
                base.Draw(batcher, x, y);

                string text = _amount.ToString();

                if (_amount >= 1000)
                {
                    if (text.Length > 4)
                    {
                        if (text.Length > 5) // >= 100.000
                        {
                            text = $"{text.Substring(0, 3)}K+";
                        }
                        else // <= 10.000
                        {
                            text = $"{text.Substring(0, 2)}K+";
                        }
                    }
                    else // 1.000
                    {
                        text = $"{text[0]}K+";
                    }
                }

                batcher.DrawRectangle(Textures.GetTexture(Color.Gray), x, y, Width, Height, Vector3.Zero);

                if (_graphic != 0)
                {
                    Vector3 hue = Vector3.Zero;
                    hue.X = 59;
                    hue.Y = 1;

                    batcher.DrawString(Fonts.Bold, text, x + 2, y + Height - 15, hue);
                }


                return(true);
            }
Ejemplo n.º 2
0
            public override bool Draw(Batcher2D batcher, int x, int y)
            {
                if (MouseIsOver)
                {
                    batcher.DrawRectangle(Textures.GetTexture(Color.Gray), x, y, Width, Width, Vector3.Zero);
                }

                //batcher.Draw2D(CheckerTrans.TransparentTexture, new Rectangle(position.X, position.Y, Width, Width), ShaderHuesTraslator.GetHueVector(0, false, 0.5f, false));

                base.Draw(batcher, x, y);

                string text = _amount.ToString();

                if (_amount >= 1000)
                {
                    text = $"{text[0]}K+";
                }

                batcher.DrawString(Fonts.Regular, text, X + 1, Width, Vector3.Zero);


                return(true);
            }