A small collection of some common and very basic utilities for libGDX games, which is used in libgdx-screenmanager and pancake.
dependencies {
implementation 'com.github.crykn.guacamole:core:$guacamoleVersion'
}
- @Beta: an annotation to denote APIs that may be subject to changes in future releases
- BooleanConsumer, FloatConsumer, ShortConsumer, ICallback
- ClassUtils: contains utilities for dealing with classes
- ConcatenatedIterator: this class aggregates multiple iterators into one
- DaemonThreadFactory: a
ThreadFactorycreating daemon threads - Exceptions:
#throwAsRuntimeException(Exception),#getStackTraceAsString(Exception) - @GwtIncompatible: indicates that an API is not compatible with GWT and thus shouldn't be compiled for it
- IntRange
- MoreObjects: contains helper functions for dealing with objects which are not already included in Java's
Objectsclass - @Nullable: the
@Nullableannotation from JSpecify is provided as a transitive dependency - Pair, Triple, IntPair & IntTriple implementations (immutable)
- Preconditions: has methods like
#checkArgument(boolean, String),#checkState(boolean, String)&#checkNotNull(Object, String); is slimmer than the commonly known class from guava - StopWatch
- ThreadHandler: a class to easily offload simple, time-consuming tasks onto threads
Core project:
dependencies {
implementation "com.github.crykn.guacamole:gdx:$guacamoleVersion" // guacamole-core is included
}
Html project:
dependencies {
implementation "com.github.crykn.guacamole:gdx:$guacamoleVersion" // guacamole-core is included
implementation "com.github.crykn.guacamole:core:$guacamoleVersion:sources"
implementation "com.github.crykn.guacamole:gdx:$guacamoleVersion:sources"
implementation "com.github.crykn.guacamole:gdx-gwt:$guacamoleVersion"
implementation "com.github.crykn.guacamole:gdx-gwt:$guacamoleVersion:sources"
}
Module file (GdxDefinition.gwt.xml):
<inherits name="guacamole_gdx_gwt" />
What is added:
- DefaultInputProcessor: an
InputProcessorproviding default methods to reduce boilerplate code; is an interface alternative toInputAdapter - DisposablePool, Vector2Pool & Vector3Pool
- FPSCounter
- IntVector2: a vector for integer values
- Logger & LoggerService: supports formatting; is super-sourced on GWT via formic; use
LoggerService.getLogger(MyGdxGame.class)to obtain a logger; calling, for instance,logger.error("something went %s!", "wrong")leads to the following console output:[ERROR] [c.b.g.m.MyGdxGame]: something went wrong! - NestableFrameBuffer: a nestable framebuffer implementation, see here for details
- QuadMeshGenerator: allows easily creating different quads; is useful when applying shaders
- ReflectionUtils: utility methods for dealing with libGDX's reflection
- ShaderCompatibilityHelper: Allows converting GLSL shader code from version 120 to 150
- ShaderProgramFactory & ShaderPreconditions: Adds methods to easily create & compile a shader (
#fromString(String, String)); automatically throws exceptions when the compilation fails; prepends can be ignored - Text asset type
Desktop project:
dependencies {
implementation "com.github.crykn.guacamole:gdx:$guacamoleVersion" // guacamole-core is included
implementation "com.github.crykn.guacamole:gdx-desktop:$guacamoleVersion"
}
What is added:
- StartOnFirstThreadHelper: Starts a new JVM if the current one was not started with the
-XstartOnFirstThreadargument on macOS; this is only needed for the LWJGL 3 backend!