libgdx / RUBE thread

General discussion about the R.U.B.E editor
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

libgdx / RUBE thread

Post by tescott »

FYI--

There's a thread over on the Badlogic forums (libgdx) regarding RUBE. Thought others on this site might be interested.

http://www.badlogicgames.com/forum/view ... =15&t=7522

Depending on how things go, I hope to have a basic RUBE JSON loader for libgdx running this coming weekend.

--tim
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: libgdx / RUBE thread

Post by iforce2d »

Yeah I see that. Looks like you guys are getting things rolling! I am about to start traveling for a couple of weeks so I might not be online as often as usual, but if there is anything you need to know just ask and I will try to answer asap.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: libgdx / RUBE thread

Post by tescott »

First pass of libgdx JSON loader is up and running. It uses the libgdx Json class rather than org.json. Kudos to HeRMeS who laid the groundwork. I've been testing it today and have updated a few things in my fork.

HeRMeS github project: https://github.com/cvayer/RubeLoader

my fork of that project: https://github.com/tescott/RubeLoader

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: libgdx / RUBE thread

Post by tescott »

I've updated my fork. Now includes image support, an updated readme, and a new example demoing the loader capabilities.

https://github.com/tescott/RubeLoader

--tim
lacipalfi
Posts: 2
Joined: Mon Feb 18, 2013 6:06 pm

Re: libgdx / RUBE thread

Post by lacipalfi »

@ tescott can you please make a tutorial on using your Rube loader for libgdx ? It would help a lot, Thanks!
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: libgdx / RUBE thread

Post by tescott »

lacipalfi wrote:@ tescott can you please make a tutorial on using your Rube loader for libgdx ? It would help a lot, Thanks!
I'll try to get something done for tomorrow. Keep an eye out!

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: libgdx / RUBE thread

Post by tescott »

Hope this helps. If you still have questions after viewing, please follow-up and I'll answer as best as I can.

http://youtu.be/hgo7Pxtcoyk

--tim
souldown
Posts: 2
Joined: Tue May 07, 2013 3:21 pm

Re: libgdx / RUBE thread

Post by souldown »

Hey love the loader Tim!

The video is also very helpful, although the first part was mainly about the rube editor itself.

Also noticed the project game me errors if i didnt have the controllers project in eclipse too (just for others to note really)

Anyway! i have a quesiton, I wonderd if you could give a quick example on how to use the loader to access specific things in the scene.
For example if you wanted to edit a specific bodys attributes in some way, whats the best way to latch onto the object?

Really appreciated! :D

Stew
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: libgdx / RUBE thread

Post by tescott »

There are a few ways to access objects:
  • * scene.getWorld(): This method returns the Box2D physics world. After loading, it is populated with the bodies, joints, and fixtures from the JSON file.
    * scene.getBodies(): This method returns an array of bodies created
    * scene.getFixtures(): This method returns an array of fixtures created
    * scene.getJoints(): This method returns an array of joints created
    * scene.getImages(): This method returns an array of RubeImages defined in the JSON file. Note: it is up to the app to perform all rendering
    * scene.getMappedImage(): This method returns an array of all RubeImages associated with a particular Body.
    * scene.getCustom(): This method allows you to retrieve custom property info from an object.
    * scene.getNamed(): This method allows you to retrieve a scene object based on name. Since multiple objects can have the same name, this returns an Array<> type.
I just added the getNamed() method to the repo.

Hope this helps!

--tim
souldown
Posts: 2
Joined: Tue May 07, 2013 3:21 pm

Re: libgdx / RUBE thread

Post by souldown »

Tim, you are a Legend!
I tried tom implement it myself but i dont know my arse from my elbow with this stuff so i gave up after 2 hours! Thank you so much! :D
Post Reply