Displaying In Game Messages?

BlitzMax Forums/BlitzMax Programming/Displaying In Game Messages?

MGE(Posted 2008) [#1]
Let's say you want to throw up an alert box with a fancy background and some text on front of it. But you also want to display it with a fade in, movement, etc. How would you handle this?

1) You're somehow rendering everything off screen and just manipulating 1 object. If so...how?

2) You're manipulating the background image, text, etc, all in real time. Drawing the background, then the text, while at the same time moving, fading everthing in a group.

3) Other?

I'm probably going to use #2, but this seems like a nice case where a render to texture or similar feature (#1?) would be used.


Czar Flavius(Posted 2008) [#2]
Does changing the alpha of an image make it transparent, or am I thinking of something else?


MGE(Posted 2008) [#3]
Alpha can fade in fade out an image.


tonyg(Posted 2008) [#4]
2)


GfK(Posted 2008) [#5]
#2.


ImaginaryHuman(Posted 2008) [#6]
Number 2 is probably fast enough and since you're doing it realtime you have more options about what you can do with it animation-wise, like scaling stuff, rotating, and also animating the text itself. But for speed it would be better to have an image or two that you just draw, but again Max doesn't have that as standard.


Grisu(Posted 2008) [#7]
#1: I would render it to a single image and manipualte that to my needs.


Gillissie(Posted 2008) [#8]
I'm only speaking from B3D experience, but I think this would work in Max too.

What I do is render things in "layers". I create a new camera for each layer. The main game is one layer, and any HUD stuff or overlays are different layers. During the render section of the program, each layer shows the camera, renders, then hides the camera. Only the first camera clears the buffer first, and the overlay cameras render over the top of the buffer. This also lets you control the order of rendering overlay stuff.

The nice thing about doing it this way is that you can have ortho projected cameras for overlayed stuff like HUDs and message boxes. Plus, you don't have to worry about entities in various layers running into each other in the scene. Just make sure you move each overlay layer's camera a good distance away from each other so you don't see any entities from other layers during the render. One tip is to make a pivot point to parent everything in a layer to, so you can hide the pivot and hide the entire layer when rendering the other layers.


tonyg(Posted 2008) [#9]
#1: I would render it to a single image and manipualte that to my needs.
Grisu, what render-to-texture code would you use?

I'm only speaking from B3D experience, but I think this would work in Max too.
You might need to provide more information on how your suggestion would work in a Bmax environment as it isn't very clear to me.


MGE(Posted 2008) [#10]
Grisu - I would pay for stable DX7, OpenGL support for render to texture. I think alot of us would. ;)


Grey Alien(Posted 2008) [#11]
2). You've got my framework, that's what it does.