FontEffManager v 1.0
  • Hello everyone !
    This is FontEffManager, useful for creating complex font effects and "hgeTextBox" object.
    Thank to Windy.
    Download (header/lib + some fonts) :
    http://www.fileden.com/files/2012/4/13/3291462/FontEffManager%20v%201.0.zip

    Features :
    -UNICODE support (WCHAR /wchar_t)
    -Uses CharEx structure for drawing. (Defines all character's parameters)
    -Extremely fast.
    -Lots of stuff.

    Usage :

    Add the include/lib files to your project :
    - Include : FontEff.h & hgefont.h (Replace)
    - Lib: TextEx.lib

    Beginners :
    You'll need to:
    1 - Init (FontEff /TextEx) class.
    2 - Set TextEx::info animation by use TextEx::Math function.
    3 - Draw your custom string by TextEx::TextOut (Look like Render function (hgeFont)).

    infoData : Creates effects in "TextOut" function . (Multiply original result (info))
    Usage : infoData::m::... //Type can be : Rot,Scale,Prop,...
    Data member :
    fVal : Current mul value (Default : 1.0 (Do nothing))
    fAdd : Adds fVal (fAdd) value per character.
    fMultiply : Multiplies fVal (fMultiply) value per character.
    fEnd : If this value greater than 0, then divides itself by total character then set this value to fAdd. (Default : 0)

    Example :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    #include "FontEff.h"
    TextEx *Txt;
    //Update...
    gui->Update(dt);
    //Render...
    Txt->TextOut(100, 150, HGETEXT_LEFT, "Sample Text");//or
    //Txt->TextOut(100, 150, HGETEXT_LEFT, "123456789\n123456789123456789\n123456789\n...");
    //Init...
    Txt = new TextEx(1, fnt, 100, 150); //Id = 1; x = 100 ; y = 150
    //Do something
    Txt->Math(Scale,0.2f,5.0f); //Increase scale value by 0.2f per second. (Time : 5.0f = 5 second)
    Txt->infoData.mTrack.fEnd = 100; //You can try with Scale,Prop,... See z_TypeInfo for more details.
    gui->AddCtrl (Txt);


    Now,let's start !
    You'll need to:
    1 - Use TextEx::SetText function.
    2 - Try to discover TextEx::strTextEx (Array of character data) and view your changes immediately.
    3 - Remember TextEx::SetTextMode & TextEx::GetTextMode.
    4 - SetMath is the same as Math function,but it's target is strTextEx[nIndex].

    You can write :
    1
    Txt->Math(...)->SetText(...)->SetTextMode(...)->...


    Tip :
    1 - strTextEx has "sprSymbol" member that allow user set custom sprite instead of default character sprite.
    2 - If you want to edit text directly on the screen, disable "ReadOnly" attribute.
    3 - Don't directly change strTextEx[...].chr member ! Use edit functions instead. (TextEx::Text_... (Delete,Insert,...))
    4 - If it's buffer is full, you can use TextEx::Size_Add or TextEx::New function to allocate more space. To get size of buffer,use TextEx::GetMaxCharactersSize.
    5 - If you wanna create smooth animation effect , please change your code :
    Ex :
    1
    Txt->Math(Y, -10, 3.0f);

    To :
    1
    Txt->Math(Y, Null, Null, -10, 3.0f);


    Example : (EditBox with Tracking Effect)
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    #include "FontEff.h"
    TextEx *Txt;
    //Update...
    gui->Update(dt);
    //Render...
    gui->Render();
    //Init...
    FontLoader *fntLoader = new FontLoader("Verdana");
    Txt = new TextEx(1,new hgeFont(fntLoader->vChars,fntLoader->GetTexture()),100,150,700,50); //w = 700, h = 50
    //Do something
    // Method 1 Example (Tracking) <Before Initiate>
    /*
    Txt->Math(Tracking,5.0f,4.0f); //Increase tracking value by 5.0f per second. (Time : 4.0f = 4 second)
    //Todo : Add more init code here
     
    //Copy (info) member to all character member (strTextEx).
    Txt->SetText("Sample Text")->SetTextMode(ReadOnly, false); //Allow Edit
    */

     
    // Method 2 Example (Tracking) <After Initiate>
    /*
    Txt->SetText("Sample Text")->SetTextMode(ReadOnly, false); //Allow Edit
    for(int i = 0;i < Txt->GetTextLen();i++)
    Txt->SetMath(i,Tracking,5.0f,4.0f);
    */

    //Todo : Add more init code here
     
    //Let's rock now !
    Txt->Start();
    gui->AddCtrl (Txt);
    delete fntLoader;

    Download tutorials & samples here :
    Tutorial [0] (3)
    Sample [0] (2)

    That's just basic,I will post my documentation later.
    Any question ?
  • kvakvskvakvs July 2012
    Make these examples and docs into a README.txt or README.md (markdown) file, get a github account, and upload source to github (using tortoisegit). This will guarantee it won't be deleted from file hosting, also you can get comments and problems from other users via github issues interface.
  • laguzlaguz October 2012
    L SantalLican
    hey, i see the fonteff.h
    but this error

     
    error C2365: 'Unknown' : redefinition; previous definition was 'enumerator'
    see declaration of 'Unknown'
    error C2065: 'i' : undeclared identifier
    error C2061: syntax error : identifier 'CHAR_DESC'
    error C2383: 'TextEx::zFunc::z_UserAnimation' : default-arguments are not allowed on this symbol
    error C2146: syntax error : missing ';' before identifier 'vChars'
    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  • SantalLicanSantalLican October 2012
    Take a look at this :
    http://relishgames.com/forum/index.php?p=/discussion/6346/my-first-effect-idea-
    Download the latest version here : (Some improvements)
    http://www.fileden.com/files/2012/4/13/3291462/FontEff.rar

    Be more detailed ? Compiling errors or Linking errors ? Error lines ?
    Need project examples ?
  • laguzlaguz October 2012
    L SantalLican

    This is a compiling errors .
    i user visual studio.
    if u have project examples , please give me the examples
  • laguzlaguz October 2012
    L SantalLican

    Thank u, i see the examples.
    but same error. T^T
    so i trying to fix the error
    but i don't know. error code see ("declaration of 'Unknown'") in winioctl.h
    &&
    'TextEx::zFunc::z_UserAnimation' : default-arguments are not allowed on this symbol
  • SantalLicanSantalLican October 2012
    VS 2008 or VS 2010 ?
    "Unknown" variable ? Oh. I don't know that an another variable is exists in other header. Thanks !
  • laguzlaguz October 2012
    L SantalLican

    i use VS 2008
    yes variable
    in fontEff.h
    enum z_CharType{
    Unknown = -1 /*(This is a error code)*/,
    /*(Use GetCharacterType or FindCharacterType function.)*/
    Ansi = 0,
    Unicode =1,
    Symbol = 2,
    Temp = 3};
    oh.. Ok, Thank u
  • SantalLicanSantalLican October 2012
    Another errors (With locations) ?
  • laguzlaguz October 2012
    L SantalLican

    No another errors.
    hey, i cathed the errors
    Laguz said:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    #1. error C2365: 'Unknown' : redefinition; previous definition was 'enumerator'
    see declaration of 'Unknown'
     
    [FontEff.h]
    enum z_CharType{
    Unknown = -1, /*(Use GetCharacterType or FindCharacterType function.)*/
    Ansi = 0,
    Unicode =1,
    Symbol = 2,
    Temp = 3};
     
    [winioctl.h]
    typedef enum _MEDIA_TYPE {
    Unknown, // Format is unknown
    F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
    }


    ㅡ This error is same variable "UnKnown"
    Changed other variable
    enum z_CharType{
    UnKnown = -1, ...}

    Laguz said:

    1
    2
    3
    4
    5
    6
    7
    8
    #2. error C2065: 'i' : undeclared identifier
    ~INFO()
    {
    for(char i = 0;i < 4;i++)delete mZ[i];
    for(i = 0;i < 10;i++)
    delete UserEvent[i];
    delete mPar;
    }


    ㅡ Thie error isn't have char "for(i = 0;i < 10;i++)"
    "for(char i = 0; i < 10; i++)"

    Laguz said:

    1
    2
    3
    4
    5
    6
    7
    #3. error C2383: 'TextEx::zFunc::z_UserAnimation' : default-arguments 
    are not allowed on this symbol
     
    typedef void (*z_UserAnimation)(FontEff*,const char TypeName[256],
    int nStart = 0,int nCount = 0,float fOther = Null);
     
    z_UserAnimation UserAnimation;


    ㅡ This error is "default-arguments are not allowed on this symbol"
    The error is Initialization in Function

    ㅡ Changed Source
    typedef void (*z_UserAnimation)(FontEff*,const char TypeName[256],int nStart ,
    int nCount, float fOther );
    z_UserAnimation UserAnimation;


    Thank u, ur a keen interest my question.
    Thanks to, i corrected this error source code.
    very very thankful XDXD.
    Wonderful u!
    Good luck all days SantalLican. XDXD
  • SantalLicanSantalLican October 2012
    Good guy ! You're excellent !
    When testing : Have you caught any error message ? Or crashed ?

    Try all basic samples. I'm will post my advanced samples soon.
    And, don't forget to discover new features when possible. Any latest news, please post here, and I'll watch !
    (If you need help, please ask me)
    Thanks, and Enjoy !
  • laguzlaguz October 2012
    L SantalLican
    Thank u guy!
    when test debugging, i don't caught any error message.

    I see the
    Laguz said:

    <<div class='geshi_syntax'>

    1
    2
    1>Example - 0 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    XDXD, Thank u.


    Thanks, SantalLican
    Glad to u telling "If you need help, please ask me" for me
    expected!!, u will post the ur advanced samples.
    i'll watch ur the samples.
    please keep it well!! Thank u~
    Have a good luck~
  • SantalLicanSantalLican October 2012
    Thanks laguz !
    FontEffManager is being testing...
    The 1.1 pre-beta will be released after several days. With many new features and great optimization, FontEffManager is more and more powerful & offers about more 40% stability. (Fixed some minor problems about speed, position and rect drawing area.) A special class is FontEffLoader, which uses Xml parser to parsing data, and Xml files is very convenient way to do anything, not only useful in storing data, but also can be used to programming well. Anything can be loaded directly only by a single code, right ?
    Well, I've made a lot of change for FontEffManager, with my lovely friend, Windy. FontEffLoader likes as heart of FontEffManager, and explore the world of fonts now is very easily. With little knowledge you can become to a programmer without any complier. FontEffLoader provides lots of commands, variables creating & detecting, math functions, public variables, layered commands (If condition, While-For commands), and much more...

    Known bugs : Too complex data structure but it's not a serious problem because FontEffManager provides lots of functions and methods.
    Spacing : Incomplete feature, but you can set TrackingMode = true to avoid position data losing when FontEffManager is not in Text mode.
    Remark : Any another news will be moved to an another topic. But you can report any bug, your idea or suggestion... here.
    Or my temporary email : beststayer@gmail.com

    Happy, and Enjoy programming !

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion

Tagged

Who's Online (2)