Package: alleycat-ui
AlleyCat UIA lightweight GUI widget toolkit forUPBGE(Uchronia Project Blender Game Engine) based onCairo.IntroductionAlleyCat UIis a lightweight GUI toolkit which means it doesn't rely on native peers,
like Blender objects or any of its GUI related APIs.It doesn't necessarily mean that it'd be faster in performance or lighter in memory
consumption than those that do. However, being lightweight has its certain benefits too.Because there is no native object to worry about, it is relatively easy to create a new
type of components or extend the existing ones. Basically, you can make anything as
long as you can draw it as an image, and the library exposes aCairocontext which
provides many useful features to paint shapes.InstallThe library can be installed usingpipas follows:pipinstallalleycat-uiYou will need to haveCairolibrary in your library path in order forAlleyCat UIto work. Linux users can install it using a package manager while on Windows, you may
get it fromhere(rename it tolibcairo-2.dlland put it where Python looks for native libraries, like the value ofPATHenvironment
variable).How to UseTo use UI components provided byAlleyCat UI, you need to create a proper context
first. In most cases, you can usealleycat.ui.blender.UIto create a new context:fromalleycat.ui.blenderimportUIcontext=UI().create_context()Then you can use this context instance to create UI components, like labels and buttons
like this:fromalleycat.uiimportLabel,LabelButtonfromalleycat.ui.blenderimportUIcontext=UI().create_context()label=Label(context,text_size=18)button=LabelButton(context,text="Button 1",text_size=16)An important thing to remember is that only those components whose hierarchy is attached
to an activeWindowcan be rendered on screen. For example, if you create aPaneland add aLabelto it, they won't be visible until you add the parent panel to an
existing window.If you want to create a window like popups or frames, you can useFramewhich can be
optionally configured to be draggable and resizable. On the other hand, if you just want
to add components to the screen, you can use anOverlayinstead, which is a transparent
window that is automatically resized to fill the current screen:fromalleycat.uiimportBounds,Label,Overlayfromalleycat.ui.blenderimportUIcontext=UI().create_context()overlay=Overlay(context)label=Label(context,text="My Label",text_size=18)label.bounds=Bounds(10,10,180,40)overlay.add(label)When you are done using the UI, you need to destroy the context by invoking itsdispose()method. It is not strictly necessary if you are running the project withblenderplayer, but it may cause a crash if you run it inside Blender and stop the engine
without properly disposing the context.StatusThe project is in a very early stage of development and only provides a minimal set of
components and layout managers. Admittedly, the documentation is not sufficient to guide
new users to get started with the library at the moment.I will try to keep adding more components and enhancing the documentation. But for now,
I'd encourage you to take a look at the test cases to get a better idea of how to use each
APIs.Please use it at your own risks. If you have any questions about the project, feel free
to visitUPBGE Discord serverand askmysticfall#4102for support.LicenseThis project is provided under the terms ofGNU General Public License v3 (GPL3).