Skip to content

A basic implementation of various ui elements using python and pygame

Notifications You must be signed in to change notification settings

10menoscared07/ui-elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

UI elements

A basic implementation of various ui elements using python and pygame

Tip

Label and Button are the most commonly used ui elements.

For now the only ui elements i have implemented are the label and the button However i'll be coming back to this project and add a bunch of ui elements in the future, like :

  • Radiobutton
  • Entry box
  • Color picker
  • Popup message box
  • Breadcrumbs
  • Menu
  • Menubutton
  • File selector
  • check button
  • Progress bar

Button

buttonAnatomy

As you can see above these are some of the properties of the button i made using pygame. I made the Button class take in a Button Style class which contains all possible alterable properties of a button such as :

  • Padding
  • Font style
  • Background color
  • Foreground color
  • Font size
  • Hover effects (has to be coded if different)
  • Anti - Aliasing
  • Wrap length (move to next line when length of font exceed this variable)
  • Border

I will continuously add more and more properties each time i visit this project.

Label

Next we have a label. It is just the same as the button in terms of font properties. However it only dosent have a background rect and is only used to display text.

You can change any property of the label in the code by using the function:

Label.change( "Property", "Value")

The alterable properties are mentioned in the Label Style class

Thats it for now. See you next time :P

About

A basic implementation of various ui elements using python and pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages