more compleate gui system

in artistic since i think the controls are very big. The button close button is 60x60! It makes the gui look a little childish ~ but that is maybe because i am used to to more fine grained guis.

In technical sense i think the gui takes up lots of uv cords. The gradient parts don’t need to be so big because they will stretch nicely. Also because you did not work in on “grid” it will be a little harder to find stuff and make it fit together. Its probably nothing major though.

I like your general idea for the style of the gui slick black. Mind if I propose a set of changes?

Hey Treeform,

Oh I didn’t mean for that scale to be the actual template, I just made it bigger so that if it was shrunk it wouldn’t affect the quality. I didn’t bother to make the controls fit perfectly on a grid or anything, I just tried to artistically portray a gui and then I expected that we could modify it into your system.

Feel free to modify it, or tell me what I need to do to make it work out in your gui.

oh one quick thing, If I wanted to have several different styles of buttons (lets say colored different), would it be fairly easy to have say 3 button images with different colors in the skin and then have 3 buttons somehow in the gui? Or would it be easier to dynamically change the color in runtime with a setColor or such?

My reason for this is in my old client I dynamically changed the colors of some of the buttons to portray information in some circumstances, ie a button could highlight yellow to mean “check this out”.

Also, can the buttons portray rollover/disabled/clicked somehow?

Thanks,

C

yes its very easy. Just change the .skinType of any element and maybe self.regenerate = True and it will have skin of any thing you want. I recommend looking in the widgets.py to see how it is done.

You don’t need to make the gui bigger just in case - my GUI is pixel-perfect (which was very important to me) so one pixel on your texture will always map to one pixel on the screen if its some thing less or more then its a bug.

Hey Treeform,

So I modified that big template and put the panels and buttons etc into your gui.png that you gave with your first version. it looked pretty good, but I didn’t put in the vertical slider control, and I left some stuff there that I’m unsure what they do.

Hello. I’m noob and i have question XD.
I make menu for my game

  self.menus = [
                 ['Mapa',
                    'Obecna','Swiata','Podziemia'],
                 ['Postac',
                    'Charakterystyka','Umiejetnosci','Zadania'],
                 ['Przedmioty',
                    'Plecak','Tworzenie','Do zadan'],
                 ['Osobiste',
                    'Gildia','Sojusze','Wyzwania'],
                 ['Test',
                    'Test']
                 ]

Now i my problem how to make buttons.For exemple when i click on “Plecak” a frame “Build Winow” are visable.

Hi Zaka,

I wouldn’t get caught up in the structure used in the example treeform sent out. (ie don’t worry about the self.menus list with lists inside). That was just his clever way of saving code. If you want to make a button just make a form and put the button inside.

class FreeFloating(Form):   
    
    def __init__(self):
        Form.__init__(self,"Build window",size=Vec2(200,400))
        gui.add(self)
        
        # add test button
        self.add(Button('Button', pos=Vec2(10,30), size=Vec2(50,16), onClick=self.onTestButton))
        
        # add Lable
        self.add(Lable('Lable', pos=Vec2(10,120)))
        
        # add Textbox
        self.add(Text('Text', pos=Vec2(10,150)))
        
        # add Radiobuttons
        self.add(Radio('Radio1', pos=Vec2(10,180)))
        self.add(Radio('Radio2', pos=Vec2(110,180)))
        
        # add CheckBox
        self.add(Check('Check', pos=Vec2(10,210)))
   
    def onTestButton(self,button,key,pos):
        print 'Button pressed'

Hope this helps.

C

yes this some help but not this wahat i want XD
Meaby i make image.
First image

second

I don’t know how to make buttons from top bar.

I still fail to see what exactly you want. My guess is that when you click the menu item you want window to show and hide? Just set the button.onClick = function that shows and hides your window.

Maybe he’s saying he wants undecorated windows? Ie, hide the linux window manager?

I think he means how to open windows from the main menus and not only from the sub menus!?

self.menus = [
   ['Main',             <- call window from here
           'Character','Skills','Inventory'], <- not only from here

Wondered myself how this can be made.

And I have other (noob-)questions:

  1. Is there a way to combine scrollbars with labels and buttons? I want to make a RPG-ish inventory where the items have buttons for “use”, “drop”, etc. behind their name.

  2. Is there a way to make it possible that a scrollbar also scrolls when clicking the bar above/below the scroll handle?

  3. Is there a way to resize the scroll-handle? Its a bit too small on high resolutions, imo.

Thanks for the GUI, treeform! Its amazing!

next release will have list box and better tutorials … i just need to finish finals next Monday.

Hello. I have make all windows for my game but i don’t know how to make visable and hide windows.
This is first windows

from gui.controls import *
#from bazadanych import *
from ui import *

class Menu_start(Form):   
   
    def __init__(self,game):
        Form.__init__(self," ",size=Vec2(200,200),pos=Vec2(300,200))
        gui.add(self)
       
        # add test button
         self.add(Button('Nowa Gra', pos=Vec2(70,30), size=Vec2(50,16), onClick=self.nowa))
        self.add(Button('Wczytaj', pos=Vec2(70,60), size=Vec2(50,16), onClick=self.wczytaj))
        self.add(Button('Opcje', pos=Vec2(70,90), size=Vec2(50,16), onClick=self.opcje))
        self.add(Button('Aktualizacja', pos=Vec2(70,120), size=Vec2(50,16), onClick=self.aktualizacja))
        self.add(Button('Wyjdz z gry', pos=Vec2(70,150), size=Vec2(50,16), onClick=self.wyjdz_z_gry))
        

   
    def nowa(self,button,key,pos):
        print 'Button pressed'
        self.Postac.toggle()       <-------------------
    def wczytaj(self,button,key,pos):
        print 'Button pressed'
    def opcje(self,button,key,pos):
        print 'Button pressed'
    def aktualizacja(self,button,key,pos):
        print 'Button pressed'
    def wyjdz_z_gry(self,button,key,pos):
        print 'Button pressed'

And exemple Postac windows

from gui.controls import *
from ui import *
class Postac(Form):

    def __init__(self,game):
        Form.__init__(self,"Glowne okno postaci",size=Vec2(400,400))
        self.game = game
        #napisy
        self.staty
=self.add(Lable("Poziom\nDoswiadczenie\nPunkty",Vec2(20,40)))
gui.add(self)

But when i click on button ‘Nowa gra’ i see only erros

Hey treeform, are you still working on this impressive gui or is it cancelled?

Yeah i am working on a theme designer and a gui layout tool. Will do a new release soon. Stay tunned.

Any one has any pressing features i can implement?

screen shots of what the gui can do:

Hey Treeform,

just a way to implement button changes, and a scrollable, selectable listview. I’m eager to get your next release. Currently I’m suffering with the standard gui for now.

implement button changes
explain?
so like
pushed button?
disabled button?

hover over button is harder…

and a scrollable, selectable listview
so some thing you can add options too
and select options form
and get the options selected?

It seems that the version .2 (the latest?) is not available, gives an error when I click on it…I can get the .1 version, but would like to download the .2

yeah the data center where that was had fire. I hope it will come back up.
.2 is way old ill release .3 when i get home.