Jelajahi Sumber

Added FileLocator example (#142)

Quazi Irfan 3 tahun lalu
induk
melakukan
800caae0d5
1 mengubah file dengan 11 tambahan dan 0 penghapusan
  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`).