js api: are units in pixels or tiles?

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

js api: are units in pixels or tiles?

Post by aubergine »

There's a bunch of objects and functions in the JS API that have x,y or x1,y1,x2,y2 properties/parameters. Are they all in tiles, or are some in pixels?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: js api: are units in pixels or tiles?

Post by Per »

They are all in tiles.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: js api: are units in pixels or tiles?

Post by aubergine »

Including droid/structure/feature objects?

If so, that's good as it keeps things nice and simple :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: js api: are units in pixels or tiles?

Post by Per »

Everything should be in tile coordinates. (If we need more precision, we will be using floating point tile coordinates.)
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: js api: are units in pixels or tiles?

Post by milo christiansen »

Yay! No more ToWorld()!
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
Post Reply