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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygol_engine-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 95676148d815ae535742d8c39c2010dac1aa6ec26d18bac3739ce179612fa930
MD5 bc985a8576c09776223f172342b6e329
BLAKE2b-256 b5fad4e4be9260ea62f1d706226d0aafc0563d593661f11a4e95be297a3d8c5b

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