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.7.0.tar.gz (16.4 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.7.0-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skelform_kraken-0.7.0.tar.gz
  • Upload date:
  • Size: 16.4 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.7.0.tar.gz
Algorithm Hash digest
SHA256 b9658d37b461ebf60c78441b4c7d6070617c3bcf62d65925d652ea8488dd4bbf
MD5 8e2b54395ca410fe137095392bafcecd
BLAKE2b-256 b63715a8c926d313df8ca08a01599344d86d2490c9452dba22b63de191b62548

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for skelform_kraken-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68472839f63184355bd9ba034173fba4c1dc5ea3d424f5f81d55affc2af2e6b4
MD5 738830a74301355160c43ff969f9d385
BLAKE2b-256 7826440081c7d2780643f03d703af52cf58ad5ef22b7248008c1538a9ea67827

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