Computer Science Canada

Removing the GUI's lame "extrusions,belvels,etc..."

Author:  Geostigma [ Fri Apr 06, 2007 8:16 pm ]
Post subject:  Removing the GUI's lame "extrusions,belvels,etc..."

Is there a way to remove the box button that is created default if you make a GUI button of w/e type? If I have a picture of a button I would like it to be just a picture because if its a shape of an object (like a person) and I use the Picture transparency command, its goes transparent but I get the extruded box of grayness and it looks stupid Neutral

Author:  Clayton [ Fri Apr 06, 2007 8:23 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Unfortunately, nothing short of programming your own Button class would allow you to get rid of the gray box that is your button. I have created a Button class of my own, it's somewhere around in Turing Submissions. If you're interested, the source is there, and you can use that as a baseline for what you are trying to do.

Author:  Geostigma [ Fri Apr 06, 2007 8:25 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Really, that really sucks. I guess Ill have to fake what I'm doing with mouse.where and button clicks. I hope I can get that working with the GUI. ( I'm really starting to hate GUI's lol... Pain in my ass to learn on my own.)

Author:  Geostigma [ Fri Apr 06, 2007 11:35 pm ]
Post subject:  Re: Removing the GUI's lame "extrusions,belvels,etc..."

Okay is there a better way to GUI's then THIS
** I know im an idiot and spelled a lot of shit wrong ha..**
Turing:

%***********************************************************
%   Declaration
%***********************************************************


%Set GUI MODE
import GUI
View.Set ("graphics:800;600,nobuttonbar")

%Declare variables
var Buttion1, Buttion2, Buttion3, Buttion4 : int
var add_button, sub_button, mlt_button, div_button : int
var easy_button, normal_button, hard_button : int

var Startbuttion : int := Pic.FileNew ("start_button.jpg")
var Instructionbuttion : int := Pic.FileNew ("instructions_button.jpg")
var Quitbuttion : int := Pic.FileNew ("quit_button.jpg")
var add_button_graphic : int := Pic.FileNew ("Adding_button.jpg")
var sub_button_graphic : int := Pic.FileNew ("Subtraction_button.jpg")
var div_button_graphic : int := Pic.FileNew ("division_button.jpg")
var mlt_button_graphic : int := Pic.FileNew ("multiplication_button.jpg")
var easy_graphic :int := Pic.FileNew ("easy_button.jpg")
var normal_graphic :int := Pic.FileNew ("normal_button.jpg")
var hard_graphic :int := Pic.FileNew ("hard_button.jpg")

var instructions_text : int := Pic.FileNew ("instructions_text.bmp")
Pic.SetTransparentColor (instructions_text, black)
var Backround : int := Pic.FileNew ("Introscreen_001.jpg")
%***********************************************************
%   Main Program
%***********************************************************
    procedure Instructions
        Pic.Draw (instructions_text, 100, 120, picMerge)
    end Instructions



    procedure guiend
        GUI.Quit
        quit

    end guiend

   
procedure addition_game_easy
put "RESERVED FOR FUNCTION"
end addition_game_easy

procedure addition_game_normal
put "RESERVED FOR FUNCTION"
end addition_game_normal

procedure addition_game_hard
put "RESERVED FOR FUNCTION"
end addition_game_hard

procedure dividing_levels
    cls
    Pic.Free (Backround)
    Backround := Pic.FileNew ("Introscreen_001.jpg")
    GUI.Dispose (add_button)
    GUI.Dispose (sub_button)
    GUI.Dispose (mlt_button)
    GUI.Dispose (div_button)
    easy_button := GUI.CreatePictureButton (50, 450, easy_graphic, addition_game_easy)
    normal_button := GUI.CreatePictureButton (50, 390, normal_graphic, addition_game_normal)
    hard_button := GUI.CreatePictureButton (50, 330, hard_graphic, addition_game_hard)
    Pic.Draw (Backround, 0, 0, 0)
    GUI.Refresh
    View.Update
end dividing_levels

procedure multiply_levels
    cls
    Pic.Free (Backround)
    Backround := Pic.FileNew ("Introscreen_001.jpg")
    GUI.Dispose (add_button)
    GUI.Dispose (sub_button)
    GUI.Dispose (mlt_button)
    GUI.Dispose (div_button)
    easy_button := GUI.CreatePictureButton (50, 450, easy_graphic, addition_game_easy)
    normal_button := GUI.CreatePictureButton (50, 390, normal_graphic, addition_game_normal)
    hard_button := GUI.CreatePictureButton (50, 330, hard_graphic, addition_game_hard)
    Pic.Draw (Backround, 0, 0, 0)
    GUI.Refresh
    View.Update
end multiply_levels

procedure subtracting_levels
    cls
    Pic.Free (Backround)
    Backround := Pic.FileNew ("Introscreen_001.jpg")
    GUI.Dispose (add_button)
    GUI.Dispose (sub_button)
    GUI.Dispose (mlt_button)
    GUI.Dispose (div_button)
    easy_button := GUI.CreatePictureButton (50, 450, easy_graphic, addition_game_easy)
    normal_button := GUI.CreatePictureButton (50, 390, normal_graphic, addition_game_normal)
    hard_button := GUI.CreatePictureButton (50, 330, hard_graphic, addition_game_hard)
    Pic.Draw (Backround, 0, 0, 0)
    GUI.Refresh
    View.Update
end subtracting_levels

procedure adding_levels
    cls
    Pic.Free (Backround)
    Backround := Pic.FileNew ("Introscreen_001.jpg")
    GUI.Dispose (add_button)
    GUI.Dispose (sub_button)
    GUI.Dispose (mlt_button)
    GUI.Dispose (div_button)
    easy_button := GUI.CreatePictureButton (50, 450, easy_graphic, addition_game_easy)
    normal_button := GUI.CreatePictureButton (50, 390, normal_graphic, addition_game_normal)
    hard_button := GUI.CreatePictureButton (50, 330, hard_graphic, addition_game_hard)
    Pic.Draw (Backround, 0, 0, 0)
    GUI.Refresh
    View.Update
end adding_levels
   
    procedure Game_Start
        cls
        Pic.Free (Backround)
        Backround := Pic.FileNew ("Introscreen_001.jpg")
        GUI.Dispose (Buttion1)
        GUI.Dispose (Buttion2)
        add_button := GUI.CreatePictureButton (50, 450, add_button_graphic, adding_levels)
        sub_button := GUI.CreatePictureButton (50, 390, sub_button_graphic, subtracting_levels)
        mlt_button := GUI.CreatePictureButton (50, 330, mlt_button_graphic, multiply_levels)
        div_button := GUI.CreatePictureButton (50, 270, div_button_graphic, dividing_levels)
        Pic.Draw (Backround, 0, 0, 0)
        GUI.Refresh
        View.Update
    end Game_Start

    Pic.Draw (Backround, 0, 0, 0)
    Buttion1 := GUI.CreatePictureButton (50, 450, Startbuttion, Game_Start)
    Buttion2 := GUI.CreatePictureButton (50, 250, Instructionbuttion, Instructions)
    Buttion3 := GUI.CreatePictureButton (50, 50, Quitbuttion, guiend)

    loop
        exit when GUI.ProcessEvent
    end loop
[/syntax]

Author:  ericfourfour [ Fri Apr 06, 2007 11:44 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Geostigma, writing a GUI is not the most difficult thing to do. I personally recommend trying it out. You don't have to do anything like swing. Just something simple. Look into object orientation. Start with a button class and move on from there.

Author:  Geostigma [ Sat Apr 07, 2007 12:06 am ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

This is my GUI program or you talking about making the buttons from scratch.

Author:  ericfourfour [ Sat Apr 07, 2007 12:13 am ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

I'm talking about starting from square one. Making a simple GUI definitely helps you learn object oriented programming.

Start with cervantes' introduction to OOP in the Turing Walkthrough. It's where I started and it was probably one of the most beneficial things I've done. It showed me a whole new way to program.

Author:  Geostigma [ Sat Apr 07, 2007 10:00 am ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Okay, well I can't find what your talking about in the Turing Walkthrough or the search engine. But just to clear things up I'm asking if there is a more simple way to program a GUI then having to write out every single sub menu in Turing. Unless I have missed something and you are trying to teach me where to go with object oriented programming.

Author:  Clayton [ Sat Apr 07, 2007 10:54 am ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Classes Part I by Cervantes

Author:  Geostigma [ Tue Apr 10, 2007 6:36 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Alrighty I did a bit of work on modules and such but as of now I don't think there is anything I can do to simplify my main program as of yet. Its obvious that I'm going to run the difficulties from a different file using externals and such but I don't know if classes are really appropriate for what I'm trying to do. I think right now I may just end up using a module, export functions for each type of math. (assuming you know that my game is a math game from reading parts of the GUI)

If you have any other input then I'm all for it.

Author:  ericfourfour [ Tue Apr 10, 2007 9:18 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

I was just suggesting that you program your own buttons and use those instead of the ones from the GUI that comes with Turing. You did want a better GUI and your own custom picture buttons.

Author:  Geostigma [ Tue Apr 10, 2007 9:23 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Oh using a module. Thats actually not a bad idea but I'm not that advanced lol. I could try but thats some serious coding behind the widget module. Ill live with what I have..


EDIT: Actually after thinking about it for like 2mins I think it wouldn't be a bad side project. I'm all for it.

Author:  ericfourfour [ Wed Apr 11, 2007 10:42 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Wait. Before you start what you just said, read Classes Part 1 by Cervantes (link up a few posts).

I don't recommend writing your own GUI library. Just make a simple button class. At most 250 lines. You can also look into the button classes that are in Turing Submissions.

But, if you really want to learn how to better use Turing, read the tutorial I mentioned.

Author:  Geostigma [ Thu Apr 12, 2007 4:38 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

I have been reading the tutorials. I said I was going to and I did. I don't know what I'm doing thats making you believe I'm not trying to learn things on my own.

Author:  ericfourfour [ Thu Apr 12, 2007 9:18 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

I think you are confused about what the difference between a module and a class is. A module is completely different than a class. A class is the template for an object. An object is essentially, a variable with all sorts of special features. A module is simply a way of organizing methods into groups. Modules are in no way related to OOP.

A button class, is essentially the template for a button object. You create button objects based on the information found in the button class. It is a lot easier than it sounds.

I do believe you are trying to learn things on your own. By replying to this thread many times, posing new ideas, and asking many questions, it shows you have initiative and want to learn how to do this. Smile

Author:  Clayton [ Thu Apr 12, 2007 9:36 pm ]
Post subject:  RE:Removing the GUI\'s lame "extrusions,belvels,etc..."

Example


: