Forum

> > CS2D > Scripts > pixels
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch pixels

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt geschlossen pixels

tos12345678
User Off Offline

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

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

alt Re: pixels

DC
Admin Off Offline

Zitieren
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

alt Re: pixels

tos12345678
User Off Offline

Zitieren
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
2× editiert, zuletzt 09.01.16 17:03:13

alt Re: pixels

Ace Howl
User Off Offline

Zitieren
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

alt Re: pixels

EngiN33R
Moderator Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht