Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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 404 times)
0 Members and 1 Guest are viewing this topic.
Offline cloud

Innocent Bystander





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

Hello,

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.
Questions:
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 Kernel


Medals: 98
Projects: 11
Exp: 12 years


klaatu barada nikto


« 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?

Static Void Games - Play indie games, learn game programming, upload your own games!
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  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (55 views)
2014-11-13 12:34:49

digdugdiggy (34 views)
2014-11-12 21:11:50

digdugdiggy (29 views)
2014-11-12 21:10:15

digdugdiggy (23 views)
2014-11-12 21:09:33

kovacsa (46 views)
2014-11-07 19:57:14

TehJavaDev (50 views)
2014-11-03 22:04:50

BurntPizza (49 views)
2014-11-03 18:54:52

moogie (65 views)
2014-11-03 06:22:04

CopyableCougar4 (63 views)
2014-11-01 23:36:41

DarkCart (148 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!