Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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  
  Libgdx concept and purpose of the classes  (Read 948 times)
0 Members and 1 Guest are viewing this topic.
Offline cloud

Innocent Bystander

« Posted 2014-07-31 12:04:49 »


One more newbie here Smiley. I need help to understand how to use classes in LibGDX. I have splash screen, then main menu screen with buttons and game screen. In game screen i want to put some images. Lets say i want to change position of clicked image from start position to point B(specific position on screen).

My game class implements Screen.
should i use sprite or actor for images?
Should i use Image or Actor class for this purpose(i saw that classes on some tutorials)

or i can finish job in my game class that implements screen?  

I would appreciate if someone can explain me how to proper use LibGDX classes. Thanks
Offline KevinWorkman

« JGO Plugged Duke »

Medals: 278
Projects: 12
Exp: 12 years - Coding Tutorials!

« Reply #1 - Posted 2014-07-31 12:39:07 »

I suggest you follow a tutorial and try out each approach you mentioned. Stopping to ask "which way is better" is usually pointless and always a waste of time compared to just trying something.

What have you got so far? - Coding Tutorials!
Happy Coding forum - Come say hello!
Offline Rayexar
« Reply #2 - Posted 2014-08-11 02:47:37 »

I don't quite understand what you mean, but my Libgdx classes are like this:

I have a class which extends Game, so it has the create(), dispose(), render() etc methods. In the create() method I set the screen to a new screen (another class which implements the Screen interface).

In the render() method of the screen, I draw sprites/textures using a spritebatch. To change the position of an image on a click, I would use an Actor which has a ClickListener(), which sets the new position of the image on click.

Pages: [1]
  ignore  |  Print  

xxMrPHDxx (316 views)
2017-12-31 17:17:51

xxMrPHDxx (97 views)
2017-12-31 17:15:51

xxMrPHDxx (148 views)
2017-12-28 18:11:33

Ecumene (320 views)
2017-09-30 02:57:34

theagentd (494 views)
2017-09-26 18:23:31

cybrmynd (531 views)
2017-08-02 12:28:51

cybrmynd (471 views)
2017-08-02 12:19:43

cybrmynd (449 views)
2017-08-02 12:18:09

Sralse (408 views)
2017-07-25 17:13:48

Archive (1315 views)
2017-04-27 17:45:51
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 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‑
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!