Jump to content

Finding a resource's things


.:HyPeX:.

Recommended Posts

Posted

Hello everyone, so far i'm trying to understand a bit things on how to customly load resources.

My question so far is how to retrive the .mp3 files loaded in the meta. XML Atributes maybe, but how?

Thanks

HyPeX

Posted
check nodes called "file", take attributes called "src" and check their extension.

how do i check their extension? Split by the . and then check for the rest? (Or find by .mp3?)

Posted

An example:

  
local filepath = "songs/rock.mp3" 
local filepath = string.gsub(filepath,"songs/","") 
local songName = gettok(filepath,1,string.byte('.')) 
local songExtension = gettok(filepath,2,string.byte('.')) 
  
print(songName) -- > rock 
print(songExtension) -- > mp3 
  

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...