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.

DarkBASIC Professional Discussion / easier way to make menus

Author
Message
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 19:41
As the guys I bought DB Pro off aren't replying to my attempts to contact them regarding when the hell my software will arrive, I shall have to annoy you guys by asking questions that are probably simple and explained in the manual.

So, imagine I got a Age of Empires type game. I want the 3D world to be visible at all times but with a bunch of menu and 2D displayed images always to appear on top of this, locked in position. Now the Tutorial at the DB site shows how to make a HUD but I just can't believe this is the only way to make what I'm after. It seems as though you got to make 2D objects with an image applied to them and place them in your 3D scene locked so as they don't move on screen when the camera moves. This all sounds a bit messy and open to problems such as, what if the camera moves close to an object so that it is closer than the locked menu objects. Will they dissapear behind the object?

Is this the only way to make menus?

Thanks for any help.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Jan 2003 19:51
Try using 'disable object zdepth' on your menu object. This should force DBPro to draw the object over the top of everything else.

Or you could draw your menu to a bitmap, use get image, and then display it as a sprite.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Jan 2003 19:53
Cant say I've read the tutorial about HUD's, but I would make menus and things like that as sprites, so you can do collision detection on them (if you want), and you can set priorites.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 2nd Jan 2003 20:15
HUDS are best made with plains, locked to the camera. They will always be drawn over top of other objects, so there is little to worry about. You can also ghost your plains to make a transparent hud. You can use sprites or pasted images as menus, but this is slow on some computers.
Who did you order from?

Remember, there is ALWAYS more than one way to do something when it comes to programming.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 20:53
Thanks all.

Rapscallion, the other prob with the plains methods is that I'd like to have one plain on top of another. Now if I set them both with equal Z distance will it get confused? If I set one with a closer Z distance then they may not align correctly? Also the HUD example has them drawing the HUD plain 4 units from the camera at a size of 1x1. Now I want a 120 pixel wide menu to sit plush against the left of the screen but it seems like a case of trial and error changing the Z distance to get this to work.

The immediate advantage I can see for using plains is that I can chage the screen resolution and the plain will keep the same size proportions. Whereas using sprites it seems that they will stay at their specified size unless I write a chunk of code getting them to change with the resolution settings. Is there an easier way?

As for purchasing DB Pro. I ordered it from Share-it. I know it's been Xmas and New Year but you normally expect any online purchases to arrive with 3-5 days unless they are out of stock - I ordered on 19th December. I don't mind waiting for something but if this is the case I'd like to know how long I'm going to have to wait. They also don't seem to have telephone support. If a comapny doesn't offer this then I'd expect email support to provide a reply within 24 hours.

Moan moan moan!

Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 20:56
I also meant to ask, using spirtes it seems to blur the bmp image slightly even though it is the same resolution on screen, so anyone know if this can be prevented?

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Jan 2003 21:30
add the extra parameter with load image/get image...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 2nd Jan 2003 21:32
http://www.wanuch.com/plain.zip
Theres a proggy that will help you position your plains, and then output DB 1.x code.
(If that doesn't work, try http://www.alex.wanuch.com/plain.zip)

3-5 days? maybe 3-5 weeks... and yes, they should give you some type of support for sure...

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 2nd Jan 2003 21:33
ya, add an extra 1 to the image load command to turn off Anti-Aliasing on that image.

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 21:55
Sweet, thanks guys.

Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 22:41
eh that's odd. I was messing with sprites...all I had was six sprites on screen and a simple do...loop that was checking if the mouse was clicking at a certain x position. When running the exe the mouse would keep pausing momentarily every half a second. When I stoped the sprites from displaying it was all ok again.

Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 2nd Jan 2003 23:07
ok, now I am setting the menu up with plains but I find that loading an image such as "Load image "blah.jpg",1,1" no longer creates a non anti-aliased image but does some weird ghosting effect where the image is duplicated on top of itself.

rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 3rd Jan 2003 00:59
?
Screenshot?

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 3rd Jan 2003 01:00
What are your system specs (specifically video card)

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 3rd Jan 2003 01:25
I must of done something wrong. Re-wrote the code and now it works hunky dory.

Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 3rd Jan 2003 01:47
I usually do it the way Raps says If you lock the position of the object it stays there regardless of if you move the camera Also that way they if the user chooses a different screen res it all stays the same size and place rather than moving ala sprites. That said, you might want smaller menus/GUI/HUD with a higher resolution

* If the apocalypse comes, email me *

Login to post a reply

Server time is: 2024-05-17 02:52:14
Your offset time is: 2024-05-17 02:52:14