Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (540)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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  
  [SOLVED] Can't render tiled map  (Read 981 times)
0 Members and 1 Guest are viewing this topic.
Offline Stein102

Junior Devvie


Medals: 1



« Posted 2013-08-15 00:26:52 »

I'm trying to render a map I've made in tiled but I can't seem to figure out how to get it to work. Can anyone give me an example of how to render one all the way from loading it up to rendering it? That would be awesome.

Thanks
Offline Otreum

Junior Devvie


Medals: 6



« Reply #1 - Posted 2013-08-15 00:35:34 »

This guy has made some great simple tutorials on how to do it from scratch Wink
http://www.youtube.com/playlist?list=PLXY8okVWvwZ0qmqSBhOtqYRjzWtUCWylb
Offline Stein102

Junior Devvie


Medals: 1



« Reply #2 - Posted 2013-08-15 01:57:58 »

I copied that exact code but it's still not working.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline JESTERRRRRR

Senior Devvie


Medals: 12
Exp: 1 year



« Reply #3 - Posted 2013-08-15 03:46:17 »

I literally just did this. Do a pastebin or w/e of the relevant code and I'll have a look for you if you'd like
Offline Stein102

Junior Devvie


Medals: 1



« Reply #4 - Posted 2013-08-15 14:57:18 »

Are you using the most current version of LibGdx? I am and it's not recognizing a few of the class names.
Offline davidc

Senior Devvie


Medals: 5
Projects: 2



« Reply #5 - Posted 2013-08-15 15:07:30 »

I copied that exact code but it's still not working.

I don't know enough about this issue to help, but one thing I can say is that you really need to give us more to go on when asking for help. The single most useless bit of information you can give is "it doesn't work". What would be helpful is:
  • Are there compiler errors?
  • Are there runtime errors, perhaps in the form of a stack trace on the command line?
  • Are you getting behaviour you don't expect? What behaviour do you expect? How is this different to what you are seeing?

I've asked clients when trying to describe errors to express them in terms of words, shapes and colours. This actually works quite well.
Offline JESTERRRRRR

Senior Devvie


Medals: 12
Exp: 1 year



« Reply #6 - Posted 2013-08-15 15:54:35 »

Are you using the most current version of LibGdx? I am and it's not recognizing a few of the class names.

Are you using the latest stable release or the nightly? The new maps API isnt yet in stable
Offline Stein102

Junior Devvie


Medals: 1



« Reply #7 - Posted 2013-08-15 19:30:14 »

I'm using the latest stable build. It's LibGdx - 0.9.8
Offline sirkarpfen

Junior Devvie


Medals: 2
Exp: 2 years



« Reply #8 - Posted 2013-08-15 19:33:05 »

I'm using the latest stable build. It's LibGdx - 0.9.8

That might be the Problem. You should switch to the nightly builds because as Stein102 posted, the new map API is not yet in stable.
Offline Stein102

Junior Devvie


Medals: 1



« Reply #9 - Posted 2013-08-15 19:38:58 »

Is there a way I can change from the stable to the nightly? Using eclipse by the way.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sirkarpfen

Junior Devvie


Medals: 2
Exp: 2 years



« Reply #10 - Posted 2013-08-15 20:02:26 »

Just download the latest nightly from the libgdx website and add it to your build path in eclipse. Just the way you did it when you started with this build Smiley.
Offline Stein102

Junior Devvie


Medals: 1



« Reply #11 - Posted 2013-08-15 20:16:29 »

I actually used the LibGdx setup ui
Offline JESTERRRRRR

Senior Devvie


Medals: 12
Exp: 1 year



« Reply #12 - Posted 2013-08-16 02:45:00 »

Not a fan of eclipse.. I cocked it up and just re-ran the setup UI, allowed it to download the nightly for me
Offline Stein102

Junior Devvie


Medals: 1



« Reply #13 - Posted 2013-08-16 14:52:47 »

Thanks, got it working now. Just have some errors on loading the map itself, looks like this:


Exception in thread "LWJGL Application" com.badlogic.gdx.utils.SerializationException: Error parsing file: maps/map.tmx
   at com.badlogic.gdx.utils.XmlReader.parse(XmlReader.java:71)
   at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:100)
   at com.badlogic.gdx.maps.tiled.TmxMapLoader.load(TmxMapLoader.java:88)
   at jesse.rscl.Screens.GameScreen.<init>(GameScreen.java:49)

code is:
1  
map = new TmxMapLoader().load("maps/map.tmx")
Online Jimmt
« League of Dukes »

JGO Kernel


Medals: 139
Projects: 4
Exp: 3 years



« Reply #14 - Posted 2013-08-16 16:09:06 »

That's probably just the JVM not being able to find it, try refreshing the Android project.
Offline Stein102

Junior Devvie


Medals: 1



« Reply #15 - Posted 2013-08-17 03:21:20 »

Thanks for all the replies. Turns out I was just using the wrong compression format for my map. So simple.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (20 views)
2014-12-23 03:34:11

rwatson462 (52 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (82 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (78 views)
2014-12-05 12:39:02

SHC (89 views)
2014-12-03 16:27:13

CopyableCougar4 (93 views)
2014-11-29 21:32:03

toopeicgaming1999 (155 views)
2014-11-26 15:22:04

toopeicgaming1999 (150 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

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