Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: SOLO on November 09, 2011, 12:47:10 PM

Title: Window animating cube?
Post by: SOLO on November 09, 2011, 12:47:10 PM
Hi,
    I think this is possible but need a little help, I have a window (main MENU window) which looks like a square (cube) what I want to achieve is that on each face of the cube is a menu option - TAKE, LOOKAT, ACTION, OPTIONS

So to start, the player when he opens the menu sees the square (cube) - TAKE then When the player moves the cursor to the right side of the cube a sprite will play that makes it look like the cube is turning and then the next face shows -LOOKAT and then does the same and shows ACTION and then OPTIONS.

Also if the player moves the cursor to the Left it reverves the selection.



Can this be done with scripts and windows? for the main MENU?


Many thanks
Title: Re: Window animating cube?
Post by: SOLO on November 10, 2011, 12:12:48 PM
 ::wave

42 views and no replies?  :'(

Anyone done anything like this for a main GUI menu in WME?

Title: Re: Window animating cube?
Post by: Spellbreaker on November 11, 2011, 02:11:41 PM
It's possible, but a bit tricky:


First of all, you need to get the coordiantes where the player clicked, for example:

on "LeftClick" {
 var x = Game.MouseX;
 var Y = Game.MouseY;
}

Then, for that Coordinates you have to create all the regions and stuff you need on the Fly, for example for the Cube you would do something like:

Scene.CreateEntity("cube");
var cube = Scene.GetNode("Cube");

Now you can set the X and Y Pos, size, etc. . Same thing goes for regions. You can do all that stuff in a script and attach it to your game / scene whereever you want to load it.

Greets,

Spellbreaker
Title: Re: Window animating cube?
Post by: SOLO on November 11, 2011, 05:23:43 PM
Spellbreaker thanks for the info, but I do not want the player to click anywhere.

I want them to open the MENU by a RIGHT CLICK - Done no problem

This shows a square with the first selection - TAKE

Then as the player moves the cursor LEFT/RIGHT the window plays a sprite which depicts the square rotating to the next option - ACTION

and then onto OPTIONS and then onto LOOK.



It is getting the window to understand that if my mouse pointer reaches the edge of the window -SQUARE that it plays a sprite to rotate the square that I am having issues with.



To activate the option displayed will be the LEFT click as normal.




Hope this explains it alittle clearer.  ;D
Title: Re: Window animating cube?
Post by: odnorf on November 11, 2011, 07:09:07 PM
You can use the MouseEntry & MouseLeave events (check entity object in documentation) to play an animation when the cursor moves over a entity. Or you can check if mouse has moved to any direction by checking the MouseX & MouseY values. Animation doesn't have to be a sprite. It can also be a 3D cube.