Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (860)
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 1134 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: 287
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  

hadezbladez (2109 views)
2018-11-16 13:46:03

hadezbladez (804 views)
2018-11-16 13:41:33

hadezbladez (2080 views)
2018-11-16 13:35:35

hadezbladez (415 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (3852 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

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 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!