LazyLib 2.3 is up, get it
here (
mirror).
Important note: if you're using one of the dev versions of the console mod that are floating around, those dev versions may conflict with this LazyLib release. You can update to
this dev version from last month to avoid the issue.
The big new feature in this update is sprite font rendering. You've probably seen this in the console mod if you use it, but now it's available for all mods. Enjoy!
This release also includes the usual bugfixes and performance improvements, as well as some new methods for modders. Also more javadoc.
so much javadoc...Full changelog:
2.3 (November 12, 2018)
=========================
Bundled the Kotlin runtime library (v1.3.0) with LazyLib:
- Kotlin is an alternate JVM language that is 100% interoperable with Java
- "Core" LazyLib is and always shall be written in Java, though some features
such as the font classes are written in Kotlin for convenience's sake
- Kotlin extension methods can be found within the org.lazywizard.lazylib.ext
package in jars/LazyLib-Kotlin.jar (Java users can safely ignore this jar)
Added @Nullable and @NotNull annotations where appropriate
Added org.lazywizard.lazylib.ui.LazyFont:
- Represents a bitmap font (the same type Starsector itself uses)
- Load a font using the static method loadFont(String fontPath)
- Use createText() to create a reusable DrawableString, which can draw a
block of text repeatedly and very efficiently
- Use drawText() to manually draw text into a VBO or display list
- See LazyFont's javadoc for example usage
Changes to CampaignUtils:
- Added getEntitiesWithRep(SectorEntityToken token, String entityTag,
IncludeRep include, RepLevel rep)
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to CollectionUtils:
- Added implode(Enum toImplode)
- Added implode(Enum toImplode, String separator)
Changes to CollisionUtils:
- Added getNearestPointOnBounds(Vector2f source, CombatEntityAPI entity)
Changes to ColorUtils:
- Added glColor(Color color, float alpha)
Changes to CombatUtils:
- Added toWorldCoordinates(Vector2f screenCoordinates)
- Added toScreenCoordinates(Vector2f worldCoordinates)
Changes to FastTrig:
- Added atan() and atan2() that are much faster (though less accurate)
than the implementations in Java's core Math class
(roughly 5-20x faster; accurate to within 0.005 radians/~0.29 degrees)
Changes to MathUtils:
- Added FPI and FTAU constants, contain Math.PI and Math.PI * 2 as floats
- Added clamp(float/int toClamp, float/int min, float/int max). This clamps
the passed value within the given range. Variants are provided for both
integers and floats.
- Added getNearestPointOnLine(Vector2f source, Vector2f lineStart,
Vector2f lineEnd)
- Added getPoint(Vector2f center, float radius, float angle). This acts as an
alias for the existing getPointOnCircumference(), which is both the most
commonly used method in LazyLib as well as one of the most awkwardly named
Changes to ModUtils:
- Added isModEnabled(String modId)
- Added loadClassesIfClassIsPresent(String classCanonicalName,
List<String> classesToLoadCanonicalNames, boolean initializeClasses)
- Added getEnabledModIds()
- Added getOverrides(), returns vanilla files explicitly overridden by any
mod (ie: in that mod's mod_info.sjon 'replace' section)
Changes to VectorUtils:
- getFacing() and getAngle() now use FastTrig's new atan2() implementation
- Added getFacingStrict() and getAngleStrict(), which are slower but more
accurate (these use the old pre-2.3 atan2() implementations)
- Added isZeroVector(Vector2f vector)
- Added resize(Vector2f vector, float length)
- Added resize(Vector2f vector, float length, Vector2f dest)
- Added clampLength(Vector2f vector, float maxLength)
- Added clampLength(Vector2f vector, float maxLength, Vector2f dest)
- Added clampLength(Vector2f vector, float minLength, float maxLength)
- Added clampLength(Vector2f toClamp, float minLength, float maxLength,
Vector2f dest)
- Added rotate(Vector2f toRotate, float angle), convenience method that
stores the result in toRotate
- Added rotateAroundPivot(Vector2f toRotate, Vector2f pivotPoint,
float angle), convenience method that stores the result in toRotate
Removed from LazyLib:
- Removed isDevBuild()
Removed from SimpleEntity:
- Removed Object constructor (it used reflection, which is now blocked;
remaining options are Vector2f, WeaponAPI, and ShipEngineAPI)
Miscellaneous Javadoc improvements