Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (763)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (852)
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 1223 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: 283
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: 485
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 (489 views)
2018-06-10 19:43:48

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

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

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

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

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

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

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

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

Solater (559 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!