Skip to main content

Panda3D add-on for Kivy integration.

Project description

Panda3D-Kivy

A Panda3D add-on for Kivy integration.

The aim is to make the integration of Kivy apps into a Panda3D application almost transparent. Potential uses include creating on-screen GUI, or even RTT 3D UI's.

Usage:

First, import panda3d_kivy.app.App - make sure you do this before importing any Kivy-related stuff:

from panda3d_kivy.app import App

Then, as usual in Kivy, create a subclass of this App, and use build() or the KV autoloading system to populate your widget tree:

from kivy.uix.button import Button

class Example(App):
    def build(self):
        return Button(text='Hello, world!')

You can then instantiate and run this app inside the __init__ of your Panda ShowBase, after running ShowBase.__init__(self). You may want to create a display region for your kivy app, sized according to your needs, otherwise panda3d_kivy will automatically create one for you that will occupy the entire window. You must then pass your ShowBase as argument to the Kivy app instantiation, as well as your display region if applicable, and finally call app.run() as you normally would:

from direct.showbase.ShowBase import ShowBase

class PandaApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        self.kivy_app = kivy_app = Example(self)
        kivy_app.run()

        # The rest of your ShowBase code here


app = PandaApp()
app.run()

Voilà! You should have a working Kivy UI in your Panda application. Have fun!

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

panda3d-kivy-0.5.2.tar.gz (212.9 kB view details)

Uploaded Source

Built Distribution

panda3d_kivy-0.5.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file panda3d-kivy-0.5.2.tar.gz.

File metadata

  • Download URL: panda3d-kivy-0.5.2.tar.gz
  • Upload date:
  • Size: 212.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.10

File hashes

Hashes for panda3d-kivy-0.5.2.tar.gz
Algorithm Hash digest
SHA256 2032a9f26423a5f16e2491819cc9b3937609f49a0f2e516a6bfa9de2957f9eb1
MD5 23665a1dab27022a3d4c06fb6ad337c1
BLAKE2b-256 c1a3e8ab38094bbf101255fbcc497a6171cb4c256ed0d7fb2ddd28755675e5f5

See more details on using hashes here.

File details

Details for the file panda3d_kivy-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: panda3d_kivy-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.10

File hashes

Hashes for panda3d_kivy-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a8bf31ec9ce6b80270ff015c90781ab4f6890825687965ca523071527a5164c6
MD5 8e5a06f5ed1e525d9181286b95c028c4
BLAKE2b-256 f50e0accc940ef9cba7f659de8cadc35bd0a388ecd98b8da7c1a3d0d65817a1e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page