An In Deft Guide to creating custom GUIs for your games

 :: Blitz :: Help!

View previous topic View next topic Go down

An In Deft Guide to creating custom GUIs for your games

Post  Nighthawk0973 on Tue Oct 25, 2011 12:02 pm

Creating custom GUIs involves the use of two different commands (please note you must read my Blitz Basics thread to understand this) AppTitle() and Graphics()

The first thing we're going to go over is Graphics(), because you will need to use it first in your program

Graphics() takes 4 parameters, 2 required and 2 optional. The two required are the width and height of your GUI. These are integer values. The next two are the color deft, and the graphics mode.

Graphics mode has 4 stages, and is an integer as well.

0 = automatic mode, windowed when in the IDE and fullscreen when not (default, not recommended)
1 = Fullscreen Mode. If you want to make professional quality games this is the one for you
2 = Windowed Mode, uses a regular window
3 = Scaled Window Mode, Windowed mode except you can resize this at runtime.

Please note that if you choose '0' for your color deft, than the compiler will pick the color deft best suited for the users video card.

Here's a Question I asked myself once: "If I'm using Fullscreen GUIs, than why do I need to configure the width and height?" Well that's a good question. I figured it out now too. Say you want to create a big GUI image for your main title menu screen. Well how big do you want the image to be if it takes up the whole screen? Well the Image dimensions and the GUI 'dimensions' are the same, than you can load the image with the x and y values of 0, and the image will be displayed on the screen perfectly like you want it too! I use this tactic a lot.

AppTitle() is basically your window name. Like right now it says 'An In Deft Guide to creating custom GUIs for your games - Mozilla Firefox' on your computer right? (something like that anyways) Well you can use AppTitle to change this for your game. Just do AppTitle("Your Game Name Here") and your done!

So let's look at an example of creating GUIs and loading images on them, remember commas are marked with semicolons:

Code:

Graphics(800, 600, 16, 1)
AppTitle("GUI Test")

;Remember, that you can't load your images before the graphics making, so always make the graphics first

LoadImage("Image.png")

DrawImage("Image.png", 0, 0)

WaitKey()

End

That's pretty much all I had to say!

Hope you all enjoyed, and if you need more help on Blitz view the Blitz docs or throw me a PM!

_________________
The Grid:
I tried to image clusters of information as they moved through the computer.
Were they jets, or motorcycles? Were the circuts like freeways? I kept dreaming of a world I thought I'd never see. And then one day... I got in.
avatar
Nighthawk0973
Moderator
Moderator

Posts : 307
Join date : 2011-07-20
Age : 19
Location : In Front of My Computer

View user profile

Back to top Go down

Re: An In Deft Guide to creating custom GUIs for your games

Post  David B on Tue Oct 25, 2011 7:02 pm

Thanks! I have wondered about this some time, but have been too lazy to use Google.

_________________
Programming Language Community Forums Administrator,








___________________



___________________

avatar
David B
Administrator
Administrator

Posts : 618
Join date : 2011-07-20
Location : The Twilight Zone!

View user profile http://programmingforums.forumotion.com/

Back to top Go down

Re: An In Deft Guide to creating custom GUIs for your games

Post  Nighthawk0973 on Wed Oct 26, 2011 2:42 pm

Given Blitzs popularity, you probably wouldn't find anything anyways. Glad you liked it.

_________________
The Grid:
I tried to image clusters of information as they moved through the computer.
Were they jets, or motorcycles? Were the circuts like freeways? I kept dreaming of a world I thought I'd never see. And then one day... I got in.
avatar
Nighthawk0973
Moderator
Moderator

Posts : 307
Join date : 2011-07-20
Age : 19
Location : In Front of My Computer

View user profile

Back to top Go down

Re: An In Deft Guide to creating custom GUIs for your games

Post  David B on Wed Oct 26, 2011 2:57 pm

Nighthawk0973 wrote:Given Blitzs popularity, you probably wouldn't find anything anyways.
Which is why when people on the Alice Community Forums heard about it and laughed at me like I was an idiot, I just sat back and let those who truly love programming join, while the rest stayed in there comfort zone, unwilling to try anything new.

_________________
Programming Language Community Forums Administrator,








___________________



___________________

avatar
David B
Administrator
Administrator

Posts : 618
Join date : 2011-07-20
Location : The Twilight Zone!

View user profile http://programmingforums.forumotion.com/

Back to top Go down

Re: An In Deft Guide to creating custom GUIs for your games

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 :: Blitz :: Help!

 
Permissions in this forum:
You cannot reply to topics in this forum