Author Topic: Graphical Dialog Boxes  (Read 9891 times)

0 Members and 1 Guest are viewing this topic.

Fritos

  • Guest
Graphical Dialog Boxes
« on: June 25, 2002, 12:31:47 AM »
Is there an option or will there be one added to where you can add your own graphical dialog boxes, etc.. Like in Colonel's Bequest? I didn't see anything relating to this in the manual. Just curious.

Thanks. Excellent work!



Offline Brian Provinciano

Re:Graphical Dialog Boxes
« Reply #1 on: June 25, 2002, 01:13:03 AM »
To make customized, graphical dialog boxes with borders and such, you just need to write a little bit of script. It's all done by the script, and not the interpreter.

I played around with it a little while ago, and produced some custom windows/buttons/controls.

Look at: http://www.classicgaming.com/agisci/scigui.htm for some screen shots.

Just modify CONTROLS.SC, and you're set! Override the draw() methods and such.

Fritos

  • Guest
Re:Graphical Dialog Boxes
« Reply #2 on: June 25, 2002, 01:40:54 AM »
Thanks.. I'll see what I can come up with..

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #3 on: July 20, 2002, 06:58:30 AM »
Looks cool, but maybe that should be in a tutorial or such.

They say an image is worth a thousand words, but code is even better.

Offline Brian Provinciano

Re:Graphical Dialog Boxes
« Reply #4 on: July 20, 2002, 06:32:18 PM »
I suppose, but I need to finish the current tutorials first.

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #5 on: July 21, 2002, 03:03:15 AM »
Ofcourse. But at least tell me this:

In controls.sc I found the Draw method. There was one command in there, DrawControl(self). Obviously, that's the method you told Fritos to override.

In the Button's class, I made a Draw method with that same DrawControl(self), followed by some Graph commands to make white/d.gray lines.'

They don't work. I myself don't really need a complete tutorial on this subject, but the code to those Win95 style buttons would be sufficient. Please??

Offline Chris Cromer

Re:Graphical Dialog Boxes
« Reply #6 on: July 21, 2002, 03:11:59 AM »
I too would love to see the code to do this... I could probably do it myself after playing with the graph function a bit though.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #7 on: July 21, 2002, 04:07:24 AM »
Before trying the white/d.gray lines, I managed to add a red diagonal line on the buttons. Unfortunatly, it wouldn't show up until highlighting...

Offline Brian Provinciano

Re:Graphical Dialog Boxes
« Reply #8 on: July 21, 2002, 04:08:32 AM »
Graph commands are only used for the picture screens. I scratch the DrawControl call and replace it with DrawCel and Display calls to create a custom control.

Offline Chris Cromer

Re:Graphical Dialog Boxes
« Reply #9 on: July 21, 2002, 04:57:40 AM »
Alright I took out DrawControl, and added DrawCel and Display... the Display part is working but the DrawCel part isn't. It doesn't have a GUI around it using the view I set... does the view have to be a certain size or something?
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Brian Provinciano

Re:Graphical Dialog Boxes
« Reply #10 on: July 21, 2002, 05:13:38 AM »
All you need to do is make a view with cels for the button's border and draw it with a loop. If the button is 40 pixels wide and you use a 4 pixel cel, the loop would go from 0 to 9, for example.

You use the left, right, top, bottom properties to draw it.

It involves a lot of size calculation/size adjustment to get it all right.

I'll do a tutorial soon. However, they take a long time to do. Each take far longer to make than they take to read/learn.

The reason I never released a tutorial or the source (except to a few people) is because I personally think the game is more important the window/button styles, and want to see people making games ;)

I didn't create the custom UI from disassembling Sierra's code. It's all very very simple code that just took me a few minutes to think up/plan out. All it involves is drawing some cels and displaying some text at the right coordinates.

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #11 on: July 21, 2002, 05:24:26 AM »
Kewlies...wait a second. That reminds me of how the Gauge draws it's bar... :o
« Last Edit: July 21, 2002, 05:28:20 AM by Pikachu14 »

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #12 on: July 22, 2002, 09:13:32 AM »


[attachment deleted by admin]
« Last Edit: July 22, 2002, 09:14:11 AM by Pikachu14 »

Offline lskovlun

Re:Graphical Dialog Boxes
« Reply #13 on: July 22, 2002, 01:36:10 PM »

Allright. I got the basic button drawing routine done. But how do I center the text? I can't figure out how to calculate the center of the button!


Use TextSize() to get a rectangle for the text then center
that rectangle within that of your button. See Brian's
reference for an example of how to use TextSize().

Pikachu14

  • Guest
Re:Graphical Dialog Boxes
« Reply #14 on: July 22, 2002, 01:44:55 PM »
Nah. Calling DrawControl first then overlaying the cels is good enough...


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.041 seconds with 21 queries.