Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building a 3D Game with LibGDX

You're reading from  Building a 3D Game with LibGDX

Product type Book
Published in Aug 2016
Publisher Packt
ISBN-13 9781785288418
Pages 234 pages
Edition 1st Edition
Languages

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
       SequenceAction(Actions.delay(0.65f),
       Actions.fadeIn(0.75f))); 
       playButton...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}