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.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygol_engine-0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d7cfb700e33f4298e6f0794a8a6c44b53f9fdc775a88eb184666fe58e1b2ec7b
MD5 ca899a38b05910b9284bf0ebcc2aae4e
BLAKE2b-256 5065e160cc6734061ea510e65466a05e10573fedea3f2e70e05580bd8c196dc1

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