User Tools

Site Tools


01_user_documentation:03_interacting_with_groimp:05_project:04_module_library

Module library

Module libraries are projects exported to be usable by any other project. When exported as a library, all types (such as classes and modules) and resources (including images, shaders, and more) become available for import. These libraries can be added in GroIMP as plugins, allowing all their types to be used as plugin imports.

These libraries are called module lib.

Structure

Module lib follow the structure of GroIMP plugins. Thus, how the lib is integrated is described in the plugin.xml file, automatically created when exported.

Compiled resources

All resources included in the project are added to a compiled resource zip (.grz file), that is automatically created when exported. The resources from this zip are loaded by GroIMP on startup, and made available through the imported types and references.

The references can resolve resources from a module lib in the GroIMP path with the name: plg:{package name}.{plugin name}:{resource name}.

Compiled classes

The classes in the project are exported compiled.

Package name

By default, .rgg types are compiled without a package. It makes them all visible from the same pool. However, for ensuring a uniqueness when importing module library, a package name is required during the export. GroIMP will use the given package name as default package during the compilation.

Thus, if the project contains type with named package, they will not be affected by the package name provided.

The package name must follow java's specification on package name.

Reference wrapper

GroIMP implicitly wrap all references call in the project to be exported as module library to make them use the resources form the library.

Indeed, if a project contains a resource with the name “shaderleaf”. When exported, the module that use setShader(shader(“shaderleaf”)), needs to point as the resource from the module lib. And not a possible “shaderleaf” in a newly opened project.

The wrappers force the references to point at plg:pkg.Plugin:“shaderleaf”.

01_user_documentation/03_interacting_with_groimp/05_project/04_module_library.txt · Last modified: 2025/05/23 19:22 by sophiewachtel