class Entityjs::Assets

Public Class Methods

find_files(search) click to toggle source
# File lib/entityjs/assets.rb, line 40
def self.find_files(search)
  Dir.glob(Dirc.game_root+'/'+search).collect do |i|
    if File.file?(i)
      #remove long string
      i = i.split(Config.assets_folder+"/").pop
    end
  end.compact
  #remove nils from array too
end
search_datas() click to toggle source
# File lib/entityjs/assets.rb, line 34
def self.search_datas
  #TODO: find all other folders and generate a key in re.assets
  #DEPRECATED
  return self.find_files("#{Config.assets_folder}/*/*").select{|i| i.match(/(images|sounds)\//i) == nil }
end
valid_images() click to toggle source
# File lib/entityjs/assets.rb, line 6
def self.valid_images
  ['gif', 'png', 'jpg', 'jpeg']
end
valid_sounds() click to toggle source
# File lib/entityjs/assets.rb, line 10
def self.valid_sounds
  ['mp3', 'ogg', 'aac', 'wav']
end