Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  User Interface Animation : What to use?  (Read 1273 times)
0 Members and 1 Guest are viewing this topic.
Offline Norakomi
« Posted 2014-09-09 18:42:00 »

Hi,

I would like to create some animation for my user interface.
What tools are there? Which one are good to use.
Which one do u use?

I'm thinking about animating a transition from a menuscreen to a settings screen (and vice versa) where user interface components move on/off screen; & an animating background in my settings screen.

Offline KevinWorkman

« JGO Plugged Duke »


Medals: 285
Projects: 12
Exp: 12 years


HappyCoding.io - Coding Tutorials!


« Reply #1 - Posted 2014-09-09 18:43:59 »

This completely depends on what you're using to code the whole shebang. Is this libGDX? LWJGL? JOGL? Swing? AWT? Something else entirely? Is this on Android or on desktop? What have you tried so far?

HappyCoding.io - Coding Tutorials!
Happy Coding forum - Come say hello!
Offline Norakomi
« Reply #2 - Posted 2014-09-09 18:50:58 »

I'm using Libgdx. Creating a game to be used on android devices

In game so far i have animated everything real simple using code by just looping a couple of textures.

For example: here i animate an enemy by changing its texture over time:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
if (enemyType == 914) {//
         animationVariable += 1.2f;
         if (animationVariable < 10) {
            text = UPANDDOWNER1;
         } else if (animationVariable < 20) {
            text = UPANDDOWNER2;
         } else if (animationVariable < 30) {
            text = UPANDDOWNER3;
         } else if (animationVariable < 40) {
            text = UPANDDOWNER2;
         } else if (animationVariable >= 40)
            animationVariable = 0;




Now i want to animate a user interface & if I would animate my graphics the same way it just seems like its too much work and/or the above way just doesnt seem like the way to go:
 like i want panels moving in/out the screen, with a background that animates while i adjust some setting...things like that

I was just wondering if there are some tools out there i could use

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #3 - Posted 2014-09-11 01:55:28 »

You know that libGDX has an Animation class, right?

Even without that, the nasty if-else ladder can be reduced to this:
text = upAndDowners[((int) animationVariable) % 40 / 10];


As for UI, you should be using Scene2d ui, so the no-brainer is Actions:

1  
2  
3  
4  
5  
6  
import static com.badlogic.gdx.scenes.scene2d.actions.Actions.*;

actor.addAction(moveTo(x, y, duration));

// let's get fancy
actor.addAction(sequence(moveTo(200, 100, 2), color(Color.RED, 6), delay(0.5f), rotateTo(180, 5)));


Actions are super legit.
Offline Norakomi
« Reply #4 - Posted 2014-09-11 06:38:41 »

Tnx. Both recommendations look intereseting.
I just started implementing some scene2d stuff recently & hadn't come across actions yet, but that definitely looks usefull

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1642 views)
2018-06-10 19:43:48

EgonOlsen (1703 views)
2018-06-10 19:43:44

EgonOlsen (1155 views)
2018-06-10 19:43:20

DesertCoockie (1583 views)
2018-05-13 18:23:11

nelsongames (1183 views)
2018-04-24 18:15:36

nelsongames (1706 views)
2018-04-24 18:14:32

ivj94 (2514 views)
2018-03-24 14:47:39

ivj94 (1731 views)
2018-03-24 14:46:31

ivj94 (2812 views)
2018-03-24 14:43:53

Solater (952 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!