UI tweening

Games can use a lot of polishing in a lot of areas; one of those is UI tweening and customization. As mentioned earlier, Scene2D gives us a lot of flexibility in the user interface part of apps and one of those is UI tweening. Let's use a bit of this capability.

Let's open up the MainMenuScreen class and add the following code:

public class MainMenuScreen implements Screen { ... private void configureWidgers() { backgroundImage.setSize(Core.VIRTUAL_WIDTH, Core.VIRTUAL_HEIGHT); backgroundImage.setColor(1, 1, 1, 0); backgroundImage.addAction(Actions.fadeIn(0.65f)); titleImage.setSize(620, 200); titleImage.setPosition(Core.VIRTUAL_WIDTH / 2 - titleImage.getWidth() / 2, Core.VIRTUAL_HEIGHT / 2); titleImage.setColor(1, 1, 1, 0); titleImage.addAction(new ...

Get Building a 3D Game with LibGDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.