added it. Check it out on svn.
377 2013-10-04 13:53:41
Re: GUI clarification (40 replies, posted in Engine)
ok, we can add an option to disable events in a particular MGuiWindow.
something like gwin->ignoreEvents(true);
378 2013-10-04 09:54:37
Re: TD Testing Areas (downloads) (15 replies, posted in Showcase)
Looks good, and I see you managed to have baked static lighting interacting with Maratis dynamic lighting at the same time,
it's looking good and fast, and you can still have a handful of dynamic lights.
379 2013-10-04 09:20:14
Topic: Post mortem (0 replies, posted in Gossip)
I just discovered some of the events of last night discussion in the forum,
thanks to your multiple feedbacks and I wanted to conclude this on a separate post.
First I want to clarify that of course we follow rules of good behavior and decent language in this forum. But only to offer the best interaction between each other, and be respectful. There is absolutely no rules to restrict the subject of your game project or the theme of your fiction (in the limit of obvious decency/nudity/hate-speech). We are here to help and motivate each other and to offer some technical support.
The events of last nights were not a model of understanding and respect, that's why I removed some of the interactions.
Finally I want to let you know that VeganDev is no longer a moderator and should be welcome as a new user, we faced some incompatibility and misunderstanding during the past weeks, but I want you to be aware that for more than 2 years VeganDev removed manually thousands of spam and helped a lot of users. Thank you a lot for that.
Lets go on with good feelings and keep this forum alive
Thank you all !
380 2013-10-04 08:20:38
Re: GUI clarification (40 replies, posted in Engine)
about the order, it happen if you have 2 MGuiWindow on top of each other, is it what you have ?
381 2013-10-03 20:36:55
Re: GUI clarification (40 replies, posted in Engine)
ok, so the mouse clic is ok,
parent->isHighLight() and isMouseInside() are both dependent on the mouse motion, the coordinate of the mouse and the window size.
Or the mouse move event is not handle properly, or the mouse position is not correct (needs to be in pixel) or the window size is not defined. Did you specified the pos and size of MWindow as (0,0) for the pos and the screen size in pixel for the size ?
And yes, the order is important, if you clic on the top window, even transparent, only this one will take the event.
382 2013-10-03 15:25:14
Re: GUI clarification (40 replies, posted in Engine)
I will be surprised, I use function pointers a lot on all platform.
The problem might be with the MWindow events, or the mouse inputs,
maybe you are using the input context after it's flushed in game update ?
try to test the inputs :
if(input->onKeyDown("MOUSE_BUTTON1"))
printf("UP");
int mx = input->getAxis("MOUSE_X")*width;
int my = input->getAxis("MOUSE_Y")*height;
printf("mouse : %d %d", mx, my);
you can also try to debug "MWindow::onEvent"
to check if it's called.
If I have time I'll do some tests too.
383 2013-10-03 12:29:08
Re: GUI clarification (40 replies, posted in Engine)
Just to be sure, here an example :
If you managed to feed your MWindow with some events,
you can then handle the button events like this :
1 ) create a static function like this :
void myButtonCallback(MGuiButton * button, MGUI_EVENT_TYPE event)
{
switch(event)
{
case MGUI_EVENT_MOUSE_BUTTON_DOWN:
printf("button pressed");
break;
}
}
2 ) give the callback function pointer to the button :
button->setEventCallback(myButtonCallback);
384 2013-10-02 15:32:40
Re: GUI clarification (40 replies, posted in Engine)
You have to feed your MWindow with events,
we have to find a better way, but for now you can do this in your game update :
MSystemContext * system = engine->getSystemContext();
MInputContext * input = engine->getInputContext();
unsigned int width, height;
system->getScreenSize(&width, &height);
// mouse button
if(input->onKeyDown("MOUSE_BUTTON1"))
window->onMouseButtonDown(MMOUSE_BUTTON_LEFT);
if(input->onKeyUp("MOUSE_BUTTON1"))
window->onMouseButtonUp(MMOUSE_BUTTON_LEFT);
// and mouse move
int mx = input->getAxis("MOUSE_X")*width;
int my = input->getAxis("MOUSE_Y")*height;
window->onMouseMove(MVector2(mx, my)); // [EDIT] : sorry for the bad example
I'll start to think of a semi automatic way to send events to MWindow
385 2013-10-01 21:25:48
Re: GUI clarification (40 replies, posted in Engine)
mh, I'm not sure, it's possible.
Did you use the new MCore.lib/dll and MEngine.lib/dll to rebuild the game.dll ?
386 2013-10-01 18:40:20
Re: GUI clarification (40 replies, posted in Engine)
you have to recompile the game.dll
387 2013-10-01 18:15:54
Re: Compiling with VC 2005 (6 replies, posted in Engine)
you are trying to compile a tagged old version of maratis "\tags\Maratis-3.01",
open a command line and go to trunk/dev/
type : "python scons.py"
after the build, the final product can be found in the "prod/" directory
if you don't want to type it each time in a command line,
create a bat in trunk/dev with :
python scons.py
pause
388 2013-10-01 17:57:03
Re: GUI clarification (40 replies, posted in Engine)
A fix (to be tested) is on svn.
389 2013-10-01 17:30:41
Re: GUI clarification (40 replies, posted in Engine)
ok, I'm modifying something in the renderer,
you'll just have to recompile maratis editor with the svn sources.
390 2013-10-01 17:16:58
Re: GUI clarification (40 replies, posted in Engine)
To load a texture, use "level->loadTexture" like for level->loadFont.
For the text moving with the camera, is it working if you use the fixed renderer instead of the standard renderer ?
Is yes, I know what it is but I have to modify some code.
391 2013-10-01 14:00:17
Re: GUI clarification (40 replies, posted in Engine)
Did you create the MGuiWindow and set the size ?
MWindow * rootWindow = new MWindow();
MGuiWindow * guiwin = rootWindow->addNewWindow();
guiwin->setScale(MVector2(800, 600));
guiwin->setColor(MVector3(0.5f, 0.5f, 0.5f));
be sure also that the path to your font is correct
use a full path with c:/
or make a local path global using :
MEngine * engine = MEngine::getInstance();
MSystemContext * system = engine->getSystemContext();
char globalFilename[256];
getGlobalFilename(globalFilename, system->getWorkingDirectory(), "fonts/myFont.ttf"); // font is in project/fonts directory
392 2013-10-01 13:52:59
Re: Compiling with VC 2005 (6 replies, posted in Engine)
scons is the only up to date system.
the vc project might need some updating (if new file code was added),
but one thing is, if you compile MCore and MEngine,
you also have to recompile the editor with MCore.dll and MEngine.dll,
because the entry points are not necessary the same.
393 2013-10-01 07:55:32
Re: GUI clarification (40 replies, posted in Engine)
If you want, you can try to use the new experimental MGui in c++ in your game plugin,
use the sources directly, the new version is stand-alone.
You will find everything in branches/Experimental/
Here are the headers :
https://code.google.com/p/maratis/sourc
2FIncludes
You will also need tinyutf8 (one header lib) :
https://code.google.com/p/maratis/sourc
2Ftinyutf8
To use it, create a MWindow :
- to send input events, use onKeyDown, onKeyUp etc
- use addNewWindow() to create MGuiWindow sub-windows
- call draw() in your custom game class to draw the GUI
To add an editable text with MGuiWindow :
MGuiEditText * text = guiwin->addNewEditText();
text->setPosition(MVector2(100, 100));
text->setFont(fontRef);
text->setTextSize(16);
text->setText("Hello world !");
text->setTextColor(MVector4(1, 1, 1, 1));
ps : fontRef is a font, you can get it from your current level :
MFontRef * fontRef = level->loadFont("/Library/Fonts/Arial.ttf");
394 2013-10-01 07:26:12
Re: Soft body (9 replies, posted in Engine)
Rigid physics improvement will be easy to add, it's a bullet wrapping essentially.
Soft Body is a bit more complicated because it influence the mesh dynamically,
and MEngine uses instances for similar meshs, so there is some things to do to allow dynamic meshs
in the engine and in the renderer.
395 2013-10-01 07:23:18
Re: GUI clarification (40 replies, posted in Engine)
I started rewriting MGui to be able to use it as dynamic library,
see this post : http://forum.maratis3d.com/viewtopic.php?id=723
but it's still experimental and seems to compile good on osx only (but it uses premake)
I didn't have time to check the linux and win compilation errors yet.
But, except if you need an interface with text editing and a classic GUI, as it's 2d only and doesn't use meshs,
I don't believe MGui is the best for game, it's use it to handle software GUI (like Maratis editor).
I still think that the good step would be to create a set of Behaviors to attach to entities,
a 'Button' behavior, a "Slide" behavior etc. But it sure depend of the final use.
396 2013-09-28 09:53:09
Re: Blender and Maratis don't ''MIX" (19 replies, posted in Gossip)
I worked with multiple studios and I know some 3d artists, it's what I saw or heard,
the current tendency is to move to Maya, it's already dominant in animation.
A lot of studios stick to 3dsmax because video-game studios develop their own scripts
to improve their pipeline, it doesn't make sense for them to move to another software.
The second thing is, specially in small studios, they don't have a lot of legal 3d software licenses (I was shocked by it) so there Blender makes a lot of sense, I try to push it when I can. Last month for example, I worked on a 3d pilot for a film project, I made the animation, rendering and compositing with Blender, and when I sent the files to the client, I could send the version of Blender with it (no compatibility problem). In the end they choose to use Maya because the motion-capture studio that will do the animation is using Maya (not because it was faster or better).
The fact is today Blender is not used a lot professionally, but it will be more and more, specially in new
and independent studios (you will probably not see Blender in EA games or Ubisoft for some time though).
397 2013-09-27 07:50:35
Re: A little bit of Maratis Advertising (2 replies, posted in Gossip)
Thank you
398 2013-09-27 07:49:16
Re: Blender and Maratis don't ''MIX" (19 replies, posted in Gossip)
3dsmax is the most unstable 3d software of all,
but yes it's interface is better organized and classic.
I worked on a 3d tv serie production last year using 3dsmax and I was missing Blender.
School and studios used 3dsmax because it's the first professional 3d software (first version was on MSDOS), it's historically the 3d software of video-game studios (not animation and cinema), but today 3dsmax is replaced by Maya in big studios and by Blender in small independent studios.
I learned 3d with 3dsmax, it's was my first software choice, but I would encourage you to learn Blender or Maya.
3dsmax is the past.
Maya and Cinema4d can export collada, so it can also be used directly with Maratis.
399 2013-09-26 19:34:16
Re: Blender and Maratis don't ''MIX" (19 replies, posted in Gossip)
I worked with 3dsmax a lot before, personally and professionally, and I can tell you today that Blender is more powerful and flexible, Maya is not bad thought.
Maratis can now load Collada files, so you can totally import meshs from 3dsmax or Maya, Collada supports animations, uvs and materials.
Use File > Import 3d model,
and select the collada file to import to your Maratis project.
Maratis will convert the collada and save them as native .mesh files in your_project/meshs/
You may have to tweak some little things by opening the converted files with a text editor (it's xml)
for example to create multi-animations or modify the materials.
400 2013-09-23 18:10:59
Re: Velocity (3 replies, posted in Scripting)
yes, because velocity is distance/time and that the logic is running at 60fps,
you can simply calculate the length of the difference vector of the two positions in time.