wade.app.onIsoTerrainMouseDown incorect tile information
UnitSeven
App = function()
{
    // this is where the WADE app is initialized
	this.init = function()
	{
        // load a scene
		wade.loadScene('scene1.wsc', true, function()
        {
            // the scene has been loaded, do something here
            wade.app.onIsoTerrainMouseDown = function(data)
            {
                console.log(data);
 
            }
        }
        );
	};
};

Sorry for bad english.
I'm trying to learn wade engine. So i picked up "isometric" video tutorial.

Mine problem is that when i click on tile edges in some cases i get wrong tile coordinates.

What may cause problem ?
Or what information i need to provide ?

P.S. there is only onIsoTerrainMouseDown event or there is more? Maybe somewhere is list ?

All 11 Comments
Gio

Hi

The isometric terrain mouse events are:

  • onIsoTerrainClick
  • onIsoTerrainMouseMove
  • onIsoTerrainMouseDown
  • onIsoTerrainMouseUp

 

As for the wrong coordinates - I think I know what you mean. Especially if you are using "cube" tiles (not flat ones, but tiles with height), the engine tries to determine the collision shape automatically, but it only works properly if there are no transparent borders on the tile picture that you are using.

It may be fixable by changing the tile picture slightly. Or it may be a bug that we need to fix. Could you post the tile picture file that you are using? Or send me a private message (clicking on my user name) if you don't want to post it publicly.

Thanks

UnitSeven

thank you a lot for your reply and event list.

Tiles i'm using  from your site (video tutorial - gras). I used same for all map.

Gio

If it's a flat tile and it's one that we used for the tutorial, I'm not sure why you get incorrect tile information. Can you make an example so I can understand in what way it's incorrect?

UnitSeven

none

So when i click on 1 i get coordinates 0:1
on 2 -> 0:1
on3 -> 1:1

Gio

Thanks UnitSeven, that was very helpful.

There was definitely a bug (that was introduced in WADE 3.1). I've now fixed it and the fix will be in the next release.

Gio

Fixed in 3.2.1, just released :)

UnitSeven

i think something is wrong any way....
you need more information ?

UnitSeven

Well anyway its not working for me :(

when i click in place where is red star i get gridcoords x3 z1 (instead 3:0) and character mowes there. (see attached image)

// JavaScript Document

App = function()
{
    this.init = function()
    {
		
        // load a scene
		wade.loadScene('server/getmap.php', true, function()
            {
                // the scene has been loaded, do something hereasdasdasdsadsdgd
     				//alert('done');
                wade.app.onIsoTerrainMouseDown = function(data)
                {
                    console.log(data);
                    var fPersas = wade.getSceneObject('swordsman_0');
                    fPersas.getBehavior('IsoCharacter').setDestination(data.gridCoords);

                }
            }
        );
    }
    // zoom
    this.onMouseWheel = function(eventData)
    {
        var cameraPos = wade.getCameraPosition();
        cameraPos.z -= eventData.value * 0.05;
        wade.setCameraPosition(cameraPos);
    };
}

// WADE (Web App Development Engine) - version 3.2.2

I'll tryed Online editor there is all ok i think...
But when i run on my PC i get mistakes in coordinates

BTW i'm trying to use NOT full screen but div like box... maybe problem somewhere there... How i can debug this???

p.s. i add zoom to be able click on distant coords. More far i click more biger mistake i get.
 

Gio

> BTW i'm trying to use NOT full screen but div like box... maybe problem somewhere there... How i can debug this???

If it works full screen and in the editor, but does not work when you run it in a div, yes, there is most likely some problem there. Can you try putting it in an iframe inside that div, and let it run full screen? This would just make it use the full size of the iframe, it would still be the size of your div and not full screen, but any mouse input problems should hopefully disappear.

UnitSeven

well in full screen mode all cliks working...
i'll try to put mine interface on top of wade DIV then

Gio

That's a valid way of doing it, but what I'm trying to say is that id doesn't have to be full screen.

If you put it inside an iframe, you can very easily make it any size you like. As far as the game is concerned, it still thinks it's full screen so all mouse events will work like they do in full screen, but it won't actually be full screen.

I will look into why input events aren't working properly when it's just inside a div.

Post a reply
Add Attachment
Submit Reply
Login to Reply