Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Code: Gui module or include file

  1. #1

    Code: Gui module or include file

    Hi folks,

    one thing we will need, no matter which game we will decide on, is a GUI module or include file which provide the following functionality:

    1) Setup a grafical interface (via OpenGL/TBGL), based on images and dynamically build elements
    2) Save and load functionality from/into XML files
    3) an editor to create the gui on screen
    4) React on mouse, keyboard and controller input
    5) Work independantly from the rest of a game

    GUI elements should be at least ...

    - Window
    - Button
    - Checkbox
    - Radiobutton
    - Label
    - Textbox (mayber scrollable)
    - Frame

    It would be nice if this gui would be skinable but if it would totally dynamic then I would say it would be great too.

    If someone would like to work on this or allready have something like this in the pipeline, then please let us know.

    Michael

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Code: Gui module or include file

    Hi Mike,

    I know you might not like my idea , but what about using skinned UI window to do the job for load / save / options screens? I attach very basic example. This way we will get all the comfort UI provides, and still can influence the look of dialogs a bit.

    In the example just press ESC to access menu.


    Petr

    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Gui module or include file

    Petr,

    adding the following code will be also possible to move dialog:

    In global space:
    [code=thinbasic] DECLARE FUNCTION ReleaseCapture LIB "USER32.DLL" ALIAS "ReleaseCapture" () AS LONG
    [/code]

    In dialog calback
    [code=thinbasic]
    CASE %WM_LBUTTONDOWN
    CALL ReleaseCapture
    dialog send cbhndl, %WM_NCLBUTTONDOWN, %HTCAPTION, %NULL

    case %WM_MOVE
    TBGL_ClearFrame
    TBGL_SceneRender(%sScene)
    TBGL_DrawFrame

    [/code]

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Code: Gui module or include file

    Hi Eros,

    when the dialog would be moving, it would call render function.
    But in most games the dialog is just centered in window and you cannot move it.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Code: Gui module or include file

    Quote Originally Posted by Psch
    when the dialog would be moving, it would call render function.
    oh, thanks.
    Amended above code works fine.

    Your idea seems an elegant and easy to use solution that can bring all the functionalities of UI module to manage game options.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6

    Re: Code: Gui module or include file

    I ment a solution for using inside a game screen. But thanks anyway, I'll check your code later.

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Code: Gui module or include file

    Mike,

    I know you meant rendered GUI, but I choose now to work on particles.
    Once I have them done, I can check out this, but not sooner, to not split "powers" too much.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8

    Re: Code: Gui module or include file

    Petr, I didn't expect you to work on all of these things. You should leave something to the others too, you know

  9. #9

    Re: Code: Gui module or include file

    Ok, I had a look with your sample. I'm my oppinion it works only if you want to have a dialog with regular windows controls. And then you still have regular looking controls, just the background is skinned.

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Code: Gui module or include file

    Yes Mike,

    that is true ... when I think of it this fact could make a strange contrast for the game, we will see.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 1 of 4 123 ... LastLast

Similar Threads

  1. Code: Web Hiscore module or include file
    By Michael Hartlef in forum Code
    Replies: 9
    Last Post: 10-10-2008, 23:06

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •