Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Radar/Overhead Cam

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 30th Oct 2009 06:13
Hey guys, I want to create a radar that shows up in a little circle to the bottom left of the screen but the code that I'm using causes the camera to disappear from view and I'm not sure how to fix it.




Also, right now, I'm just using a square window, I'm not sure how to make it a circle.

Thank You
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 30th Oct 2009 10:57 Edited at: 30th Oct 2009 10:58
You have been asking a lot of questions lately related to issues you should be able to solve by simply tampering with the systems. I think patience is what you need, to be perfectly honest. Test the code. Use C++'s excellent debugging tools to step through the code and see what happens and when.

You can't ask the community to solve all your errors for you, or you might as well ask for it to write the code.
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 30th Oct 2009 20:44 Edited at: 30th Oct 2009 20:46
You assume that I haven't "tampered" with it already. I spent a good five hours on it. I only ask questions when I absolutely don't know what to so, otherwise I wouldn't be wasting my time here; I'd be writing code.

And to be perfectly honest, you can't stop me from asking questions.

I can't ask the community to solve all my errors for me but I can ask you to be quite if your not going to be help.

So be quite.
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 30th Oct 2009 21:06 Edited at: 30th Oct 2009 21:08
for what reason are you using -ScreenHieght etc..
and to make it a circle, you should try to make a circular image in Photoshop or something and make the center transparent, then the rest either black or blurred, place it over the camera view and you should only see the transparent image part of the image

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 31st Oct 2009 05:18
@SFCBia

I'm using ScreenHeight because my game sets the programs resolution automatically, which means that the size of the camera box is never constant.

As for the circular deal, I thought about that but wouldn't it look funny with a blurry square in the hud? Maybe I should take an alternative to making a radar and do a 2D plane elsewhere and then put objects on that based on the 3D data.
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 31st Oct 2009 05:30
by using the negative of the return from ScreenHeight(), you are setting the view port above the top of the window. Meaning that there is a camera view there, you just will never see it.

I would suggest changing this:

dbSetCameraView(1, 0, -dbScreenHeight()/4, dbScreenWidth()/4, -dbScreenHeight());


To this:

dbSetCameraView(1, 0, dbScreenHeight()-dbScreenHeight()/4, dbScreenWidth()/4, dbScreenHeight());


Slapping on a negative doesn't make it so that it will start from the other side. It makes it so that it will go in the opposite direction the same number of steps.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 31st Oct 2009 21:49
Thanks H,

I hadn't thought of that.

But ultimately it ends up looking funny.

I'm thinking just drawing a 2D circle on the screen and drawing stuff on it would make a better radar.

What do you think?
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 31st Oct 2009 22:12
Personally, I believe it all depends on the style/form you are using with your game for which dimension of radar you use. I think with smaller games it doesn't matter as much, as long as it shows the information accurately. My experience with radars(so far) has only been a 3d box simulating a 2d radar, so personally I don't know if it will be better. I say go for it though, nothing helps you learn better than trial and error(in my opinion).

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 31st Oct 2009 22:46
Yea, this is a slightly larger game where the radar is imperative.

I found the dbCircle() function to create a 2D circle and then put stuff in it.

However for some reason the circle doesn't show up on the screen and I've tried it in two different programs. But the dbLine() function works perfectly.

Do you know what I'm doing wrong?

Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 31st Oct 2009 22:53
for some reason dbCircle() and dbDot, and maybe some others, don't work on some machines. From the looks of your code, you should see the circle, so my guess is that your machine is one of those ones that it doesn't work on. there are a few different solutions you can do, one being just drawing a circle in a program like paint, and then posting it with the bg color as the transparency key. another would be to hard code the circle using just dbLine(), which would take more time and effort.

Login to post a reply

Server time is: 2024-10-01 16:48:11
Your offset time is: 2024-10-01 16:48:11