Skip to content

apysc (pronounced æpisk) is a Python frontend library to create HTML and JavaScript, inspired by ActionScript 3 (as3) and Flutter.

License

Notifications You must be signed in to change notification settings

simon-ritchie/apysc

Repository files navigation

apysc

Deploy to PyPI CodeQL Dependabot: enabled PyPI version License: MIT

logo

Language: | English | 日本語 (Japanese) |

apysc (pronounced æpisk) is a Python frontend library to create HTML and JavaScript, inspired by ActionScript 3 (as3) and Flutter.

Notes: Currently developing and only works partially.

Supported Python Version

Python 3.8 or later.

Installing

Pip command is available:

$ pip install apysc

What's new

To check the major features updating and destructive changes, please see the Discussions' Announcements and Destructive changes.

How to start

Please see apysc documentation and quick start guide page.

What apysc can do in its current implementation

  • Save HTML or use it on the Jupyter Notebook, JupyterLab, and Google Colaboratory!

Documents:


  • Draw the many types of vector graphics

Example code fragments:

...
sprite.graphics.begin_fill(color=ap.Color("#0af"))
rectangle: ap.Rectangle = sprite.graphics.draw_rect(x=50, y=50, width=50, height=50)
...

Abstract document: Draw interfaces abstract


  • Lots of the vector graphics updating interfaces, such as the x, width, rotation, alpha (opacity), ellipse size, scale

Example code fragments:

...
rectangle.x = ap.Number(100)
...

Abstract document: DisplayObject and GraphicsBase classes base properties abstract


  • Set each mouse event, such as the click, double click, mouse down, mouse up, mouse over, mouse out, mouse move

Example code fragments:

...
def on_click(e: ap.MouseEvent, options: dict) -> None:
    ap.trace("Rectangle is clicked!")


rectangle.click(on_click)
...

Abstract document: MouseEvent interfaces abstract


  • Use the timer interface and animation

Example code fragments:

...
def on_timer(e: ap.TimerEvent, options: dict) -> None:
    ...


ap.Timer(on_timer, delay=1000).start()
...

Documents: Timer class


  • Lots of tween animations, including easing options

Example code fragments:

...
rectangle.animation_x(
    x=100, duration=1000, easing=ap.Easing.EASE_IN_QUART,
).start()
...

Abstract document: Animation interfaces abstract (each animation attribute)


  • Basic control, like the for loop, if branch instruction, and so on

Documents:


For more details, please see the following document:

What apysc can do in its current implementation

License

The apysc library is under the MIT License.

The logo image uses the following Creative Commons license font:

Also, the apysc library depends on the following libraries and assets: