How to get the exact position point of an entity?

All things HTML5 or text based engines, or really any web based engines.
Post Reply
alex_king92
Posts: 12
Joined: Fri Aug 30, 2013 9:21 am

How to get the exact position point of an entity?

Post by alex_king92 »

I'm using an isometric map and I need to know the exact point where an entity is (not isometric tile), especially while it's moving. Which attribute of my entity must I get?
alex_king92
Posts: 12
Joined: Fri Aug 30, 2013 9:21 am

Re: How to get the exact position point of an entity?

Post by alex_king92 »

Sorry, solved.
If anybody other has the same question, the answer is:

Code: Select all

var wordPos = entity.worldPosition();
It's explained in .../ige-master/documentation/root/IgeEntity.html
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: How to get the exact position point of an entity?

Post by coolbloke1324 »

Also you can use:

entity.translate().x()

To get and set the x co-ordinate (same for y and z) and also

entity.rotate().z()

and

entity.scale().x()

You can also access the translate, rotate and scale data via:

entity._translate
entity._rotate
entity._scale

However worldPosition() will also take into account parent transforms whereas the above data is local to the parent.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: How to get the exact position point of an entity?

Post by robaldred »

it might also be worth mentioning

Code: Select all

entity.screenPosition()
This is a position relative to the browser viewport, I've found it useful placing DOM elements
Post Reply

Return to “HTML5/Web Engines”