Skip to main content

No project description provided

Project description

PyGol

PyGol is a pure python library which is based on pygame and simplifies its functions. Heavily inspired by Solar2D

How to install?

pip install pygol-engine


Hello World Example:

from pygol.ui import Window
from pygol.drawable import Text
from pygol.routine import perform_with_delay

win = Window(width=400, height=400)
win.show()
text = Text('Hello, world!', 'Comic Sans MS', 60, 0, 5, (0, 0, 0))
win.insert(text)

#Update function
def update():
    if win.pygame_window != None:
        text.x = (win.pygame_window.get_width()/2)-(text.get_size()[0]/2)
        text.y = (win.pygame_window.get_height()/2)-(text.get_size()[1]/2)

# Perform with delay: 10 millis; function: update; repeats: 0
perform_with_delay(10, update, 0)

Rotating rectange example:

from pygol.ui import Window
from pygol.drawable import Rect, Group
from pygol.routine import perform_with_delay

win = Window(width=700, height=400, title='Example')
g = Group(225, 70, 200, 200)
r1 = Rect(0, 0, 100, 200)

global angle
angle = 0

def rotate():
    global angle
    g.rotate(angle)
    angle += 1

if __name__ == '__main__':
    win.bg = (0, 0, 0)
    win.show()
    win.insert(g)
    r2 = Rect(100, 0, 100, 200, (0, 0, 255))
    g.insert(r1)
    g.insert(r2)
    

    perform_with_delay(10, rotate, 0)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygol_engine-0.7.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pygol_engine-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: pygol_engine-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for pygol_engine-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 339fa40e27ae0393cfdaf6bdd74d103acfd2ca573e3e0ea5779827359e8b60b3
MD5 dd08e1def2c4933d9ec6a80ac9077b71
BLAKE2b-256 e9e0024a71837cff3f1b568b5d62b8452b4ce8aecd21e9998a83d6fdbc3e8b9d

See more details on using hashes here.

Supported by

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