How to get the exact position point of an entity?
-
- Posts: 12
- Joined: Fri Aug 30, 2013 9:21 am
How to get the exact position point of an entity?
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?
-
- Posts: 12
- Joined: Fri Aug 30, 2013 9:21 am
Re: How to get the exact position point of an entity?
Sorry, solved.
If anybody other has the same question, the answer is:
It's explained in .../ige-master/documentation/root/IgeEntity.html
If anybody other has the same question, the answer is:
Code: Select all
var wordPos = entity.worldPosition();
- coolbloke1324
- Posts: 181
- Joined: Mon Jan 23, 2012 5:20 pm
Re: How to get the exact position point of an entity?
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.
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.
Re: How to get the exact position point of an entity?
it might also be worth mentioning
This is a position relative to the browser viewport, I've found it useful placing DOM elements
Code: Select all
entity.screenPosition()