Forum

> > CS2D > Scripts > How to get a map sprite x, y position?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to get a map sprite x, y position?

2 replies
To the start Previous 1 Next To the start

old Re: How to get a map sprite x, y position?

Cure Pikachu
User Off Offline

Quote
Like the region where the sprite from cs2d entity env_sprite is covering?
1
2
3
4
5
local x1, y1, x2, y2
x1 = x * 32 + entity(x,y,"int2")
y1 = y * 32 + entity(x,y,"int3")
x2 = x1 + entity(x,y,"int0")
y2 = y1 + entity(x,y,"int1")
where
x
and
y
represent the x and y tile position of the sprite entity itself.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview