package org.cyclops.cyclopscore.helper;

import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;

/**
 * A helper for rendering.
 * @author rubensworks
 *
 */
public class RenderHelpers {
    
    /**
     * Bind a texture to the rendering engine.
     * @param texture The texture to bind.
     */
    public static void bindTexture(ResourceLocation texture) {
    	Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    }

	/**
	 * Convert r, g and b colors to an integer representation.
	 * @param r red
	 * @param g green
	 * @param b blue
	 * @return integer representation of the color.
	 */
	public static int RGBToInt(int r, int g, int b) {
	    return (int)r << 16 | (int)g << 8 | (int)b;
	}

}

@@ -73,16 +73,115 @@
 ecraft;%0A
+import net.minecraft.client.gui.FontRenderer;%0Aimport net.minecraft.client.renderer.GlStateManager;%0A
 import n
@@ -830,10 +830,2326 @@
 )b;%0A%09%7D%0A%0A
+    /**%0A     * Draw the given text and scale it to the max width.%0A     * @param fontRenderer The font renderer%0A     * @param string The string to draw%0A     * @param x The center X%0A     * @param y The center Y%0A     * @param maxWidth The maximum width to scale to%0A     * @param color The color to draw%0A     */%0A    public static void drawScaledCenteredString(FontRenderer fontRenderer, String string, int x, int y, int maxWidth, int color) %7B%0A        drawScaledCenteredString(fontRenderer, string, x, y, maxWidth, 1.0F, maxWidth, color);%0A    %7D%0A%0A    /**%0A     * Draw the given text and scale it to the max width.%0A     * The given string may already be scaled and its width must be passed in that case.%0A     * @param fontRenderer The font renderer%0A     * @param string The string to draw%0A     * @param x The center X%0A     * @param y The center Y%0A     * @param width The scaled width%0A     * @param originalScale The original scale%0A     * @param maxWidth The maximum width to scale to%0A     * @param color The color to draw%0A     */%0A    public static void drawScaledCenteredString(FontRenderer fontRenderer, String string, int x, int y, int width, float originalScale, int maxWidth, int color) %7B%0A        float originalWidth = fontRenderer.getStringWidth(string) * originalScale;%0A        float scale = Math.min(originalScale, maxWidth / originalWidth * originalScale);%0A        drawScaledCenteredString(fontRenderer, string, x, y, width, scale, color);%0A    %7D%0A%0A    /**%0A     * Draw the given text with the given width and desired scale.%0A     * @param fontRenderer The font renderer%0A     * @param string The string to draw%0A     * @param x The center X%0A     * @param y The center Y%0A     * @param width The scaled width%0A     * @param scale The desired scale%0A     * @param color The color to draw%0A     */%0A    public static void drawScaledCenteredString(FontRenderer fontRenderer, String string, int x, int y, int width, float scale, int color) %7B%0A        GlStateManager.pushMatrix();%0A        GlStateManager.scale(scale, scale, 1.0f);%0A        int titleLength = fontRenderer.getStringWidth(string);%0A        int titleHeight = fontRenderer.FONT_HEIGHT;%0A        fontRenderer.drawString(string, Math.round((x + width / 2) / scale - titleLength / 2), Math.round(y / scale - titleHeight / 2), color);%0A        GlStateManager.popMatrix();%0A    %7D%0A%0A
 %7D%0A

Add support for scaled string rendering in guis