GUI help
Blitz3D Forums/Blitz3D Beginners Area/GUI help
| ||
Im trying to make a GUI, and I am having problems. I loaded the gui using this:Global interface = LoadImage ("interface.bmp") and after updating the world, rendering it I added this: DrawImage interface,0,0 Flip The program was running fine, but once I added the background GUI, the program has crawled to almost a hault! Why is this? |
| ||
You don't by any chance have the LoadImage code inside your main loop do you? |
| ||
no the loadImage command is not in the main loop. I think the reason its running slow is Im running on a stock 3d graphics card. I just read in the blitzcoder site that loading a 800x600 imagine on a crappy video card will slow the program down a whole lot. I tried changing the graphics3d to graphics3d 800,600,16,2 and it seems to be running normal, the problem is, every object on the screen is very jagged. There must be another solution? This can be a big problem if Im trying to develop something, since I do not want to limit my audience to a high end graphic card system. My comp is very new, its came with a garbage video card :) I would imagine many people out there have a similar condition. So the question is, how do you optimize your game to run on *not so good* 3d graphics cards? Any Tricks? |
| ||
Hum, may be decreasing the image colour depth could help. Also, do you run the prog with debug enabled ? If so, turn debug mode off. I've seen you use a windowed mode; bare in mind that full screen mode is usually faster than windowed one. I assume you have this in the main loop: ;main loop . . Updateworld Renderworld drawimage interface,0,0, flip ;end of main loop BTW, why do you need such a large image if you just need to show a little GUI ? You may better use small texturized sprites for that, so you can also play with transparency (entityalpha), while you can't with a normal drawimage command. Hope this helps, Sergio. |
| ||
The color depth is definately the key. The gui is mainly a background, with places for buttons for spells, characters pick, and other interface requirements. I needed something that covers the screen while leaving a big space in the middle for the 3d graphics. I suppose I could have chopped the image up into 4 pieces. It seems to be working since the color depth has been decreased. Does a big image like this slow things down a lot normally? |
| ||
Does a big image like this slow things down a lot normally? Not on a good gfx card with lots of videoram. Anyway, is always good to try to consume less videomem as possible, so the game will run also on low specs gfx cards. What I suggest you is to chop the image in small pieces, as you have already stated. And decrease the colour depth for each, too. It's really unuseful to have a big image that covers the screen, when the main part of it will be transparent. More, if you want to change the position of a sigle button you have to edit the whole image, while if you use single pictures for each button, you just have to change the drawing coordinates in your code. Experiment... Sergio. |
| ||
thanks sergio, i will try that instead. I had the image masked where the camera displays through and also where the buttons are located. The buttons are individual pictures. I think I am going to try the technique you have stated and see what happens. Also, I have been trying all day to create decent buttons. The problem is, all buttons + mouse cursor have black (or dark grey) pixels around it. I am not pleased by this quality. Is it because I am blurring the images in photoshop? I'll have to experiement with this as well. So far, all images are not looking the way I want. How do people handle up/down/over states for buttons? They dont? :) -charlie |