Forum

> > CS2D > Scripts > pixels
Forums overviewCS2D overview Scripts overviewLog in to reply

English pixels

5 replies
To the start Previous 1 Next To the start

old closed pixels

tos12345678
User Off Offline

Quote
Hi, how checking pixels X and Y in editor.

Example application: spawn effect or x - y teleport player.

old Re: pixels

DC
Admin Off Offline

Quote
The editor shows the tile coordinates. Each tile has the size of 32x32 pixels. This means you can multiply the tile coordinates with 32 to get the pixel perfect position of the top left corner of the tile you were hovering.

Add additional 16 (half of 32) to x and y to get the center position of that tile.

e.g.:
IMG:https://snag.gy/HmSOH.jpg

The tile position is 38|13 here. First value is x, second is y.

x = 38 tiles * 32 pixels = 1216 pixels
y = 13 tiles * 32 pixels = 416 pixels
for the top left corner of the hovered tile.

center would be
x = 1216 + 16 = 1232
y = 416 + 16 = 432

old Re: pixels

tos12345678
User Off Offline

Quote
Oh. Thanks admin

1
2
3
4
xjaile = 1
yjaile = 1

timer(15000,"parse",'effect "colorsmoke" "..xjaile*6120-60 .." "..yjaile*2490-75) 48 32 255 0 0')

wrong! HELP
edited 2×, last 09.01.16 05:03:13 pm

old Re: pixels

Ace Howl
User Off Offline

Quote
that is incorrect to state your coordination.

1
2
3
4
jail = {x = 6120-60, y = 2490-75}


timer(15000,"parse",'effect "colorsmoke" "..jail.x.." "..jail.y.." 48 32 255 0 0')

By the way, sorry for not actually fix your code, im not on my laptop

old Re: pixels

EngiN33R
Moderator Off Offline

Quote
Since your question in this thread has been answered, do not use it to ask another unrelated question, especially since you've asked it in another thread already.

Closed.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview