Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Local to Global (https://forums.graalonline.com/forums/showthread.php?t=74085)

cbk1994 05-20-2007 03:08 PM

Local to Global
 
I need to take an X and convert it to the X on the screen. This doesn't work ...

temp.co = GraalControl.localtoglobalcoord( { this.x - 3.5, this.y - 2.7 } );

it doesn't convert it to global. It just keeps the numbers the same.

Help please :(

Chompy 05-20-2007 03:12 PM

and what is this.x and this.y?

cbk1994 05-20-2007 03:13 PM

It's a level NPC, this.x and this.y work fine. I just need this.x to magically be the screenx for that x.

Chompy 05-20-2007 03:15 PM

but localtoglobalcoord() is for GuiControls..

cbk1994 05-20-2007 03:18 PM

Oh, I see what you're saying. I was thinking it was for converting the level x and y to global.

Okay, well are there any ways to do this?

godofwarares 05-20-2007 03:25 PM

Quote:

Originally Posted by cbkbud (Post 1309882)
Oh, I see what you're saying. I was thinking it was for converting the level x and y to global.

Okay, well are there any ways to do this?

If I understand, You want to change the level coordinates to screen coordinates. To do this:

PHP Code:

screenx(xy)
screeny(xy

They will return the screen position at (x, y).

cbk1994 05-20-2007 03:42 PM

Quote:

Originally Posted by godofwarares (Post 1309884)
If I understand, You want to change the level coordinates to screen coordinates. To do this:

PHP Code:

screenx(xy)
screeny(xy

They will return the screen position at (x, y).

I love you <3

godofwarares 05-20-2007 04:07 PM

Quote:

Originally Posted by cbkbud (Post 1309888)
I love you <3

:]

Rapidwolve 05-20-2007 11:36 PM

Or you can just multiply by 16. (I think)

DustyPorViva 05-21-2007 12:13 AM

Quote:

Originally Posted by Rapidwolve (Post 1310025)
Or you can just multiply by 16. (I think)

Nah, that wouldn't work because it needs to translate the x/y of it with consideration for the camera coordinates and such.


All times are GMT +2. The time now is 03:20 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.