Slick Forums

Discuss the Slick 2D Library
It is currently Sun Nov 17, 2019 6:00 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Resources manager
PostPosted: Mon Dec 06, 2010 4:24 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
A week ago I started a project for resource management, it is on googlecode by now http://code.google.com/p/jresourcesmanager/.

The idea of the project is to provide an easy way to declare resources/assets used by an application and to have an easy way to reload them on runtime.

In this video you can see dynamic resource reloading working.

Hope can be of use.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2010 10:34 pm 
Offline
Game Developer
User avatar

Joined: Wed Feb 17, 2010 12:24 am
Posts: 598
cool.

How do you determine if it reload it or not, timestamp or checksum?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2010 11:58 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
Reload is not automatic for now, but it is the idea to be, and I was thinking to use file timestamp. Right now, in the video I am using handling a key event to reload the resources.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 07, 2010 9:40 am 
Offline
Game Developer
User avatar

Joined: Wed Feb 17, 2010 12:24 am
Posts: 598
ok, I get it. That's neat.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 07, 2010 7:02 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
I was experimenting a bit with monitor file modification date, I have a running example where you modify an image and it is automatically reloaded :D....

Here is a quick example (to be modified probably).

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 07, 2010 10:34 pm 
Offline
Game Developer
User avatar

Joined: Wed Feb 17, 2010 12:24 am
Posts: 598
Nice. Something like that might go well with an http downloader ;)

If you have a game you could automatically pull the images/maps/etc from web if user doesn't have em. That's probably a bit over complicating it though.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2010 1:16 am 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
Right now, you could define your resources using remote data sources, there is an example showing that.

Here is the example, I know it is not polished enough, but it shows a resource using a remote data source.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2011 3:27 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
I know nobody is using the project, but to know, it was moved to github to jresourcesmanager, and there is also a little of how to use documentation too.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Resources manager
PostPosted: Tue Jul 10, 2012 4:36 am 
Offline

Joined: Mon Apr 09, 2012 6:04 pm
Posts: 22
Are you able to specify a folder and load all files within it? I can in Eclipse (Directory.listfiles or something similar, then classify the files by their extension) but the problem is that when I export to a jar to run on a webpage, java runs into read permission expressions. So I'm forced to manually type the path for each asset. I took a glance at your source and it wasn't immediately obvious, were you able to solve this problem?


Top
 Profile  
 
 Post subject: Re: Resources manager
PostPosted: Tue Jul 10, 2012 1:28 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
No, right now the framework doesn't have anything automatic for that. However, if you have your own directory/folder explorer you could register resources for each file.

But the answer is the framework doesn't solve your problem (or I didn't understand it correctly).

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group