Пример #1
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    void OnEnable()
    {
        script = target as MadFont;

        inputType = serializedObject.FindProperty("inputType");

        texture    = serializedObject.FindProperty("texture");
        forceWhite = serializedObject.FindProperty("forceWhite");

        glyphs              = serializedObject.FindProperty("glyphs");
        linesCount          = serializedObject.FindProperty("linesCount");
        fillFactorTolerance = serializedObject.FindProperty("fillFactorTolerance");

        fntFile = serializedObject.FindProperty("fntFile");
    }
Пример #2
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================
    
    void OnEnable() {
        script = target as MadFont;
        if (script.created) {
            ReloadColors();
        }
    
        inputType = serializedObject.FindProperty("inputType");
        
        texture = serializedObject.FindProperty("texture");
        forceWhite = serializedObject.FindProperty("forceWhite");
        
        glyphs = serializedObject.FindProperty("glyphs");
        linesCount = serializedObject.FindProperty("linesCount");
        fillFactorTolerance = serializedObject.FindProperty("fillFactorTolerance");
        
        fntFile = serializedObject.FindProperty("fntFile");
    }
Пример #3
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================
    
    void OnEnable() {
        script = target as MadFont;
        if (script.created) {
            primaryColor = script.material.GetColor("_PrimaryColor");
            secondaryColor = script.material.GetColor("_SecondaryColor");
        }
    
        inputType = serializedObject.FindProperty("inputType");
        
        texture = serializedObject.FindProperty("texture");
        forceWhite = serializedObject.FindProperty("forceWhite");
        
        glyphs = serializedObject.FindProperty("glyphs");
        linesCount = serializedObject.FindProperty("linesCount");
        fillFactorTolerance = serializedObject.FindProperty("fillFactorTolerance");
        
        fntFile = serializedObject.FindProperty("fntFile");
    }
Пример #4
0
    // ===========================================================
    // Methods for/from SuperClass/Interfaces
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    void OnEnable()
    {
        script = target as MadFont;
        if (script.created)
        {
            primaryColor   = script.material.GetColor("_PrimaryColor");
            secondaryColor = script.material.GetColor("_SecondaryColor");
        }

        inputType = serializedObject.FindProperty("inputType");

        texture    = serializedObject.FindProperty("texture");
        forceWhite = serializedObject.FindProperty("forceWhite");

        glyphs              = serializedObject.FindProperty("glyphs");
        linesCount          = serializedObject.FindProperty("linesCount");
        fillFactorTolerance = serializedObject.FindProperty("fillFactorTolerance");

        fntFile = serializedObject.FindProperty("fntFile");
    }
Пример #5
0
    public override bool HasPreviewGUI()
    {
        MadFont font = target as MadFont;

        return(font.material != null);
    }
    // ===========================================================
    // Constructors
    // ===========================================================

    public MadFontBuilder(MadFont font)
    {
        this.font = font;
    }
Пример #7
0
    private Rect GlyphBounds(MadFont.Glyph g, out float xAdvance) {
        float realScale = scale;
        float xOffset = 0, yOffset = 0;

        float baseScale = font.data.infoSize / (float) font.data.commonScaleH;
        realScale = g.height / baseScale * scale;
        xOffset = g.xOffset / baseScale * scale;
        yOffset = g.yOffset / baseScale * scale; // wrong?
        xAdvance = g.xAdvance / baseScale * scale * font.textureAspect;

        float w = (realScale / g.height) * g.width;

        return new Rect(xOffset, yOffset, w * font.textureAspect, realScale);
    }
Пример #8
0
 // ===========================================================
 // Constructors
 // ===========================================================
 
 public MadFontBuilder(MadFont font) {
     this.font = font;
 }