Author Topic: Positions  (Read 904 times)

How do I place a red dot on a Hud with a position received from gettransform();?

First, get the x and y coordinates

%x = getWord(Object.getPosition(), 0);
%y = getWord(Object.getPosition(), 1);

Then do offshift or multiplication or division or whatever idk

And then set the position of the dot to %x SPC %y

First, get the x and y coordinates

%x = getWord(Object.getPosition(), 0);
%y = getWord(Object.getPosition(), 1);

Then do offshift or multiplication or division or whatever idk

And then set the position of the dot to %x SPC %y
Thanks captain obvious

He's asking about how to actually get it in a GUI, most third graders know how to handle simple coordinates

Thanks captain obvious

He's asking about how to actually get it in a GUI, most third graders know how to handle simple coordinates
Your post didn't help more did it

Anyways
I never did anything with guis my laptop always crashes when I open gui editor D:

If you're making a minimap, you'll need to do something like this:

Code: [Select]
%pos = vectorSub(%position, serverConnection.getControlObject());
%x = getWord(%pos,0);
%y = getWord(%pos,1);
%HUD = MyHud;
%centerx = getWord(%hud.extent,0)/2;
%centery = getWord(%hud.extent,1)/2;
%redDot = new guiBitmapCtrl()
{
bitmap = "./RedDot";
visible = 1;
};
%HUD.add(%redDot);
%redDot.position = %centerx + %x SPC %centery + %y;

This is really crude and won't be circular but that should be the basics. I don't see why not.
« Last Edit: August 07, 2012, 09:28:36 PM by TripNick »

Quote from: TripNick
This is really crude and won't be circular but that should be the basics. I don't see why not.
What will it be square?

Yeah. To make it circular you need to use sin and cosin to get the boundary requirements to make it circular. I can do it I just didn't include it in that example.

Is this for like a radar or something?

Just curious.

Look what I just made out of interest..



For someone that sucks at math like me, I'm proud I actually managed this. forget you, trigonometry.


If this is something like what you're making, you can look at my code here (with the player position finder removed, Badspot has removed too many ways of getting that already..)

http://pastebin.com/GJrUzUwV

(Note: this code is super messy and unoptimized, such as most code is when you're figuring out how to do stuff)
« Last Edit: August 08, 2012, 12:22:31 AM by TripNick »

nvm post is dumb i misunderstood slick's post
« Last Edit: August 08, 2012, 12:28:22 AM by Truce »

Is this for like a radar or something?

Just curious.
Yea I'm making a server sided radar to show where a person is when they fire a gun

Yea I'm making a server sided radar to show where a person is when they fire a gun
But GUIs are client sided.

Yea I'm making a server sided radar to show where a person is when they fire a gun
That's a pretty neat idea

But GUIs are client sided.
Exactly they need to download the GUI if they want to run the feature on servers that are supported

Now how do I remove the dot?
%gui.remove(%dot);?

Got it
« Last Edit: August 08, 2012, 10:44:08 AM by Aide33 »