Re: MGui "v2" news

The 3 additional external scripts (freeimage, freetype & glfw) are not modified (as they require no linking). They are located in the 'Projects' folder.

So you can test now without hesitation !

Last edited by com3D (2013-10-17 14:06:50)

52

Re: MGui "v2" news

How do you use MGuiEditText?
I cannot type something in it because something like this does not exist:

if(input->onKeyDown("ANY"))
   rootWindow->onKeyDown(input->currentlyPressedCharacter);

Re: MGui "v2" news

yes right now a better mechanism is needed to feed the character events,
the trunk version of Maratis doesn't really support unicode like the new experimental branch.

I'll think about something, maybe committing the unicode fix in the trunk.

54

Re: MGui "v2" news

I'm using the experimental branch. But what has Unicode anything to do anyway, I just need to type A-Z and 0-9.
The point is that I would have to do if key==A then send A, if key==B then send B, etc

Re: MGui "v2" news

unicode is important, or you'll be limited to type MAJ only,
you are using MGui.2 with the current branch of Maratis as a plugin yes ?
(current branch is ASCII, when the new experimental branch is unicode)

Anyway, some development is needed.

The only thing you can do right now is to access ASCII characters and special keys one by one :

char name[2] = {0, 0};

// A to Z
for(int i=65; i<=90; i++)
{
    name[0] = i;
    if(input->onKeyDown(name))
        rootWindow->onChar(i);
}

// 0 to 9
for(int i=48; i<=57; i++)
{
    name[0] = i;
    if(input->onKeyDown(name))
        rootWindow->onChar(i);
}

// special keys
if(input->onKeyDown("UP"))
    rootWindow->onKeyDown(MKEY_UP);
if(input->onKeyDown("DOWN"))
    rootWindow->onKeyDown(MKEY_DOWN);
if(input->onKeyDown("LEFT"))
    rootWindow->onKeyDown(MKEY_LEFT);
if(input->onKeyDown("RIGHT"))
    rootWindow->onKeyDown(MKEY_RIGHT);

if(input->onKeyDown("BACKSPACE"))
    rootWindow->onKeyDown(MKEY_BACKSPACE);
if(input->onKeyDown("ENTER"))
    rootWindow->onKeyDown(MKEY_RETURN);
if(input->onKeyDown("SPACE"))
    rootWindow->onKeyDown(MKEY_SPACE);

// and do the same with onKeyDown

not pretty and not the best, but we'll add a better automatic way at some point.

56

Re: MGui "v2" news

LOL I'm so stupid, I didn't think of doing a loop.

Ok your code works, it just seems you have to do

rootWindow->onChar(i)

instead of

rootWindow->onKeyDown(i)

Re: MGui "v2" news

Yes you are right it's "onChar"
(EDITED on top)