Skip to main content

A 2D graphics API that mimics the Processing API

Project description

PieFish

PieFish is a 2D graphics API that mimics the Processing API.

Installation

  1. Download the repository as a .zip file.
    OR use pip to install it from PyPI (and skip all other installation steps, unless you want to try out the example):

    pip install piefish
    
  2. Make sure you've got all of the required pip packages installed:

    • pygame
    • colorama

How to use

Main script setup

First of all, you need to import piefish:

    import piefish

Note: since all functions for drawing are part of the piefish namespace, you might want to use import piefish as pf instead.

After that, you can initialize PieFish by calling the 'init()' method:

    piefish.init()

The nice thing about PieFish is that the update loop is already setup for you. The only thing you need to do is add your functions to the update loop by adding them to a function pool.

Function pools are lists of functions that get called at a certain point in the kernel loop. For example, the "draw"-pool gets called every frame, whilst the "setup"-pool only gets called at the start of the program.

You can add functions to a function pool as follows:

@piefish.kernel.pool("draw", 1)
def yourFunction():
    # Do something

The number after the name of the draw pool indicates the priority of that function in the pool. Functions with a higher priority will be executed before others.

To start the kernel loop, add this line at the end of your main script:

piefish.kernel.run()

Your final script should look like this:

import piefish as pf

pf.init()

@pf.kernel.pool("setup",1)
def onSetup():
    # do something

@pf.kernel.pool("draw",1)
def onDraw():
    # do something

pf.kernel.run()

All functionality is included in the example, and you can use it as a reference to create your own application.


PieFish 0.1.9a

Change log

  • Changed all occurences of pyvis to piefish. That's all.

PieFish 0.1.8a

Change log

  • PieFish is now a PyPI package!
  • Renamed package to PieFish to remove name conflicts (I had to come up with something..)
  • Some other minor stuff

Hotfixes

  1. 0.1.8a1
    • updated this file
  2. 0.1.8a2-a4
    • very minor details including this file

PieFish 0.1.5a

Change log

  • Further improvements in kernel loop.
  • Added splash screen.
  • Expanded functionality in fps monitoring.
  • Improved and added log messages.
  • Command line colors! :D

PieFish 0.1.3a

Change log

  • Improved kernel loop performance.
  • Fullscreen now works properly.

Project details


Download files

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

Source Distribution

piefish-0.1.9a0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

piefish-0.1.9a0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file piefish-0.1.9a0.tar.gz.

File metadata

  • Download URL: piefish-0.1.9a0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.2

File hashes

Hashes for piefish-0.1.9a0.tar.gz
Algorithm Hash digest
SHA256 054856c87d7eb935e9fe1ae2be727b2cdf54a5393ab47aa6e2fbb76739a0ec26
MD5 01baba26dccaf4496367268fe922276e
BLAKE2b-256 12048e64c555f26b1bacf4cb558b3e98ac9cec0f8c32606218ff561c08850256

See more details on using hashes here.

File details

Details for the file piefish-0.1.9a0-py3-none-any.whl.

File metadata

  • Download URL: piefish-0.1.9a0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.2

File hashes

Hashes for piefish-0.1.9a0-py3-none-any.whl
Algorithm Hash digest
SHA256 339eec3d27149a80471acf2d06279990f334cad5b83a9180724d471e846487b4
MD5 5f78470b9c5c59aa46b013d3bd2049a5
BLAKE2b-256 612b53ddd3d5dd096027cbb3d5914e4435a0e9ce7e2147a555d7bbf3019847d2

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