@@ -0,0 +1,1641 @@
+package com.badlogic.gdx.ingenuity.utils;%0A%0Aimport com.badlogic.gdx.graphics.g2d.BitmapFont;%0Aimport com.badlogic.gdx.graphics.g2d.GlyphLayout;%0Aimport com.badlogic.gdx.math.Rectangle;%0Aimport com.badlogic.gdx.scenes.scene2d.Actor;%0Aimport com.badlogic.gdx.scenes.scene2d.Stage;%0Aimport com.badlogic.gdx.utils.Align;%0A%0Apublic enum GdxUtil %7B%0A%09;%0A%0A%09public static Rectangle getTextBounds(String text, BitmapFont bitmapFont) %7B%0A%09%09GlyphLayout glyphLayout = new GlyphLayout();%0A%09%09glyphLayout.setText(bitmapFont, text);%0A%09%09return new Rectangle().setSize(glyphLayout.width, glyphLayout.height);%0A%09%7D%0A%0A%09public static Rectangle getWarppedTextBounds(String text, float wrapWidth, BitmapFont bitmapFont) %7B%0A%09%09GlyphLayout glyphLayout = new GlyphLayout();%0A%09%09glyphLayout.setText(bitmapFont, text, bitmapFont.getColor(), wrapWidth, Align.left, true);%0A%09%09return new Rectangle().setSize(glyphLayout.width, glyphLayout.height);%0A%09%7D%0A%0A%09public static void center(Stage stage, Actor actor) %7B%0A%09%09float wd = stage.getWidth() - actor.getWidth();%0A%09%09float ht = stage.getHeight() - actor.getHeight();%0A%09%09actor.setPosition(wd / 2, ht / 2);%0A%09%7D%0A%0A%09public static void center(Actor staticActhor, Actor actor) %7B%0A%09%09actor.setPosition(staticActhor.getX() + (staticActhor.getWidth() - actor.getWidth()) / 2, staticActhor.getY() + (staticActhor.getHeight() - actor.getHeight()) / 2);%0A%09%7D%0A%0A%09public static void replace(Actor oldActor, Actor newActor) %7B%0A%09%09if (oldActor != null && oldActor.getParent() != null) %7B%0A%09%09%09newActor.setBounds(oldActor.getX(), oldActor.getY(), oldActor.getWidth(), oldActor.getHeight());%0A%09%09%09oldActor.getParent().addActorBefore(oldActor, newActor);%0A%09%09%09oldActor.remove();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

add gdx/ingenuity/utils/GdxUtil.java