Skip to main content

A pakage to create easy gui in Python

Project description

pygamergui-0.6

A simple gui library made using python and pygame module as core.

Authors

🔗 Links

portfolio Facebook twitter

How to install ?

Install module

  pip install pygame,pygamergui

Demo Video

video

Demo image

image

Demo code

from pygamergui import buttons,slider,text,window


def b1test(args):
    t1.text = "use->"
    print(args)


def b2test(args):
    t1.text = "Pygamergui"
    print(args)

anemi = text.Word_Animation("pygamergui",color='red')

b1 = buttons.simple_button(target=b1test,
                         text='use',
                         fg='white',
                         w=75,
                         h=50,
                         color=(0, 175, 250),
                         args=[1]
                         )

b2 = buttons.simple_button(target=b2test,
                         fg='white',
                         text="PGG",
                         w=100,
                         h=50,
                         color=(0, 175, 250)
                         )

t1 = text.text("what to use??")

r1 = buttons.button_radio(radius=30, color='cyan')

s1 = slider.slider(300,
                  550,
                  h=10,
                  corner_round=10,
                  color='purple',
                  t1_align='side',
                  text_size=20,
                  text_color='black',
                  color_circle=(0, 175, 250)
                  )


def update():
    b1.show_no_anemi(200, 400, window=windowm, corner_round_level=10)
    b2.show_color_change(300, 400, window=windowm, corner_round_level=10)

    t1.show(windowm, 175, 175)

    a=r1.show(windowm, 300, 300)
    if a:
        anemi.show(windowm,180,100,4)
    a = s1.show(windowm)
    

windowm = window.app(title='test',
                    bgcolor=(40, 40, 40), 
                    target=update, update_rate=10, 
                    background="python1.png"
                    )
windowm.run()

Project structure

structure

Appendix

Important points:

  1. all widgets (i.e button,text,slider,Button_radio)can be used importing text,buttons,slider from pygamergui.

  2. background image path should be provided to window class as in example

  3. window class makes the main window appear

  4. All the show methods should be put in an function which is passed as target to window class

Badges

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygamergui-0.6.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

pygamergui-0.6-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page