소스 검색

Added FileLocator example (#142)

Quazi Irfan 3 년 전
부모
커밋
800caae0d5
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      docs/modules/tutorials/pages/beginner/hello_asset.adoc

+ 11 - 0
docs/modules/tutorials/pages/beginner/hello_asset.adoc

@@ -217,6 +217,17 @@ Here is a HttpZipLocator that can download zipped models and load them:
 
 ----
 
+Here is a FileLocator that allows assetManager to open asset file form a particular directory,
+
+[source,java]
+----
+
+    assetManager.registerLocator("<Path to directory containing asset>", FileLocator.class);
+    Spatial model = assetManager.loadModel("ModelName.gltf");
+    rootNode.attachChild(model);
+
+----
+
 JME3 offers ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, and UrlLocator (see `com.jme3.asset.plugins`).