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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygol_engine-0.4.1-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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66f9826e7a1f993d384b5e2117a91fbd565a6b1a9237d80f5f6ecfcfe106c033
MD5 fa0c0551ffabd8dd9138646fc7371064
BLAKE2b-256 b44f2327bb1406897fcea80d97a83a4f9ca0e7023f5d6306e9f0b9aeebb4a41a

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