# Class cocos.tiles.Resource

Load some tile mapping resources from an XML file.

## Methods

| __init__(self, filename)
| find_file(self, filename)
| resource_factory(self, tag)
| requires_factory(self, tag)
| register_factory(cls, name)
| handle(self, tag)
| __contains__(self, ref)
| __getitem__(self, ref)
| find(self, cls) Find all elements of the given class in this resource.
| findall(self, cls, ns=`'````'`) Find all elements of the given class in this resource and all <requires>'ed resources.
| add_resource(self, id, resource)
| get_resource(self, ref)
| save_xml(self, filename) Save this resource's XML to the indicated file.

## Class Variables

| cache = ``{``}``
| factories = `{'resource': resource_factory, 'requires': require`...``

## Class Variable Details

### factories

Value:

      {'resource': resource_factory, 'requires': requires_factory,}