English pixels

5 replies
Goto Page
To the start Previous 1 Next To the start
09.01.16 02:21:14 pm
Up
tos12345678
User
Offline Off
Hi, how checking pixels X and Y in editor.

Example application: spawn effect or x - y teleport player.
09.01.16 02:27:21 pm
Up
DC
Admin
Offline Off
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:http://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
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
09.01.16 02:52:32 pm
Up
tos12345678
User
Offline Off
Oh. Thanks admin

Code:
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
09.01.16 05:10:11 pm
Up
Ace Howl
User
Offline Off
that is incorrect to state your coordination.

Code:
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
09.01.16 05:40:34 pm
Up
tos12345678
User
Offline Off
Nothing 0 effect
09.01.16 05:45:10 pm
Up
EngiN33R
Moderator
Offline Off
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.
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
To the start Previous 1 Next To the start