Skip to main content

SkelForm runtime for Kraken Engine

Project description

SkelForm runtime for Kraken Engine.

pip install skelform_kraken

Demo

After installing the library:

skelform-demo

Usage

import skelform_kraken as skf

Basic Setup

  • skf.load() - loads .skf/.skfe file and returns armature & textures, to be used later
  • skf.animate() - transforms the armature's bones based on the animation(s)
  • skf.construct() - provides the bones from this armature that are ready for use
  • skf.draw() - draws the bones on-screen, with the provided style(s)

1. Load:

(armature, textures) = skf.load("skellington.skfe")

This should only be called once (eg; before main game loop), and armature and textures should be kept for later use.

2. Animate:

# use `skf_pg.time_frame()` to get the animation frame based on time (1000 = 1 second)
time = 2000
frame = skf.time_frame(time, armature.animations[0], False, True)

print(frame) # will be at the 2 second mark of the animation

armature.bones = skf.animate(armature, [armature.animations[0]], [0], [0])

Note: not needed if armature is static

3. Construct:

center = kn.Vec2(screen.get_width()/2, screen.get_height()/2)

final_bones = skf.construct(
    armature,
    screen,
    skf_pg.AnimOptions(
      pos=center
    )
)

Modifications to the armature (eg; aiming at cursor) may be done before or after construction.

4. Draw:

skf.draw(final_bones, armature.styles, textures, screen)

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

skelform_kraken-0.6.0.tar.gz (13.0 MB view details)

Uploaded Source

Built Distribution

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

skelform_kraken-0.6.0-py3-none-any.whl (419.9 kB view details)

Uploaded Python 3

File details

Details for the file skelform_kraken-0.6.0.tar.gz.

File metadata

  • Download URL: skelform_kraken-0.6.0.tar.gz
  • Upload date:
  • Size: 13.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skelform_kraken-0.6.0.tar.gz
Algorithm Hash digest
SHA256 45fc6b2420161d4081d1f7c3086ddf8f011f7e27036e91e21576749f3201d8bb
MD5 1401334528aff3a53ff3703c2d84bab7
BLAKE2b-256 727b59c34c97055b7a263191a9b8c27e6b25646fa0d688eb98b504a17632d9a8

See more details on using hashes here.

File details

Details for the file skelform_kraken-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for skelform_kraken-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4fa2515ee0acddab371083eee293e4c54f6039729742a0cadae9483090476c
MD5 d7975c77f1a7a2277b198d3230971778
BLAKE2b-256 1640e70aaea51b64836f2a515710bee8ae27f9a8b249aeb9f500f3adbc2ea930

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