Example #1
0
        public new void Render()
        {
            base.Render();
            float w = width / (float)label.getRenderString().Length / 3.5f;

            if (.52f * w > .13f * height)
            {
                w = .13f * height / .52f;
            }
            label.RenderString(label.getRenderString(), xCoords[0] / 10, (yOffset - w * 2.6f) / 20, w);
        }
Example #2
0
        /**
         * Change the label rendered by the text
         * @param f
         */
        public void SetLabel(GameFont f)
        {
            label = f;
            string str = label.getRenderString();

            switch (align)
            {
            case Alignment.LEFT:
                xOffset = -1.5f;
                break;

            case Alignment.CENTER:
                xOffset  = -0.05f / (0.3f / size);
                xOffset *= str.Length;
                break;

            case Alignment.RIGHT:
                float characterShift = str.Length * 2f + 1f;
                xOffset = 1.5f - ((str.Length + str.Length / characterShift) / 10f);
                break;
            }
        }
Example #3
0
 public void Render()
 {
     label.RenderString(label.getRenderString(), xOffset, yOffset, size);
 }