console menu/gui

Blitz3D Forums/Blitz3D Beginners Area/console menu/gui

Sph!nx(Posted 2008) [#1]
Hello everybody. I'm a new guy and been working with blitz3D for two weeks now. I build a simple world where I can fly through.

I've been fiddling with menu's a bit and I can make a simple display screen with a few functions, nothing fancy. What I really need is a (still quite simple) menu with no buttons, but text input, like a console gui in modern shooters like half-life, unreal, doom, etc.

A drop down effect, like those games have, is a bit out of my league yet I guess so I figured a simple switch of views or something, like with a regular menu.

Independently, I can run both things fine, the 'console' and the world I mean, but when I combine them in a program and switch between them, things are getting messed up really bad. I've been trying many different approaches but my skills are not good enough I think.

I figured I start from scratch, again, cause the code turned in to a complete mess. My question is if someone has an example or could point me towards some documentation regarding this topic.

Thanks a lot!


Sph!nx(Posted 2008) [#2]
I kept it simple this time. I have a main loop and it automatically loads a function that displays a 'splash screen', a single image.

I'm working on a function that displays another (full screen) image with a text input, so the user can input whatever text (command) and if it matches and future functions that function will be ran. (for now, just another image)

I want it so the 'console' be activated at any time in the game. From the menu or while running a game world (map) at that users can deactivate it too and continu where they left. (I know of the 'return' command! :) )

The real problem I have is that when I switch (with the tab key) between windows, things go wrong.

For some reason it does not clear the past view and thus not render the new. It has something to do with the buffer I guess ... still, that subject is still quite difficult for me.

Any help?


Nate the Great(Posted 2008) [#3]
hmm...

I have heard of problems with using alt tab or on vista windowskey tab

I am not sure how to solve this but maybe it is in the code archives :)


Sph!nx(Posted 2008) [#4]
Thanks for your reply

I've already tried different keys. Also two keys, one to 'activate' the console and than another to close it. Same problems.

Now, I've stripped the console thing down to a single image, just like the first screen you see when the program loads.

So, its just a image and when pressing the button, the new image should show and when pressed again, the previous (first) image should show ... still not working properly and I'm pretty sure it has something to do with that buffer stuff.

Gonna go from scratch again. Just the two images and then later, when this does work, I will give the 'console' image the functions of adding input etc.

Man ... I managed to render 3D world and moving cameras, but cant seem to grasp this buffer stuff ... I feel such a n00b ... ohw, I am one ...


Sph!nx(Posted 2008) [#5]
I really need some help with this. I must have overlooked some stuff in the manual or forum...

Here's the thing:

I have a program that has a the 'setbuffer backbuffer' code. It has a mainloop and renders an image. (with the correct setup of 'updateworld', 'renderworld' and 'flip')

Now I want to call up another function with the press of a button that renders something else, like a picture and later other stuff.

How do I bring one function to the background and another to the foreground?

I really need to know this ...
thanks in advanced!


Stevie G(Posted 2008) [#6]
If you want to display a 2d image or text on top of the rendered 3d world - just call your function after renderworld and before flip.


Sph!nx(Posted 2008) [#7]
Thanks. I started from scratch again and figured out a lot more this time. I got my console thingy working and can load maps from it and switch between them!

:)


Nate the Great(Posted 2008) [#8]
I started from scratch again


You will most likely have to do that many times before you finish a game, or at least I do. Every time you reprogram something, it gets better and more efficient.


Sph!nx(Posted 2008) [#9]
Indeed. Normally, I'm the artist and thought coding was a major pain in the ass and a boring as hell to do ... man, I was wrong. I love it!