public class PolygonRegionLoader extends SynchronousAssetLoader<PolygonRegion,PolygonRegionLoader.PolygonRegionParameters>
PolygonRegions
using a PolygonRegionLoader
Modifier and Type | Class and Description |
---|---|
static class |
PolygonRegionLoader.PolygonRegionParameters |
Constructor and Description |
---|
PolygonRegionLoader() |
PolygonRegionLoader(FileHandleResolver resolver) |
Modifier and Type | Method and Description |
---|---|
Array<AssetDescriptor> |
getDependencies(String fileName,
FileHandle file,
PolygonRegionLoader.PolygonRegionParameters params)
If the PSH file contains a line starting with
params.texturePrefix , an
AssetDescriptor for the file referenced on that line will be added to the returned Array. |
PolygonRegion |
load(AssetManager manager,
String fileName,
FileHandle file,
PolygonRegionLoader.PolygonRegionParameters parameter) |
PolygonRegion |
load(TextureRegion textureRegion,
FileHandle file)
Loads a PolygonRegion from a PSH (Polygon SHape) file.
|
resolve
public PolygonRegionLoader()
public PolygonRegionLoader(FileHandleResolver resolver)
public PolygonRegion load(AssetManager manager, String fileName, FileHandle file, PolygonRegionLoader.PolygonRegionParameters parameter)
load
in class SynchronousAssetLoader<PolygonRegion,PolygonRegionLoader.PolygonRegionParameters>
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, PolygonRegionLoader.PolygonRegionParameters params)
params.texturePrefix
, an
AssetDescriptor
for the file referenced on that line will be added to the returned Array. Otherwise a sibling of the
given file with the same name and the first found extension in params.textureExtensions
will be used. If no suitable file is found, the returned Array will be empty.getDependencies
in class AssetLoader<PolygonRegion,PolygonRegionLoader.PolygonRegionParameters>
fileName
- name of the asset to loadfile
- the resolved file to loadparams
- parameters for loading the assetpublic PolygonRegion load(TextureRegion textureRegion, FileHandle file)
s 200.0, 100.0, ...
Lines not prefixed with "s" are ignored. PSH files can be created with external tools, eg:
https://code.google.com/p/libgdx-polygoneditor/
http://www.codeandweb.com/physicseditor/
file
- file handle to the shape definition fileCopyright © 2015. All rights reserved.