Add test for assets stored in drawable / mipmap directories and add verbose logging menu option support.
Still need to add the menu to the layout file for the MainActivity.define_list_fix
@ -0,0 +1,49 @@ |
||||
package jme3test.android; |
||||
|
||||
import com.jme3.app.SimpleApplication; |
||||
import com.jme3.light.AmbientLight; |
||||
import com.jme3.light.PointLight; |
||||
import com.jme3.material.Material; |
||||
import com.jme3.math.ColorRGBA; |
||||
import com.jme3.math.Vector3f; |
||||
import com.jme3.scene.Geometry; |
||||
import com.jme3.scene.shape.Box; |
||||
import com.jme3.scene.shape.Sphere; |
||||
import com.jme3.util.TangentBinormalGenerator; |
||||
|
||||
/** |
||||
* Created by potterec on 4/29/2016. |
||||
*/ |
||||
public class TestAndroidResources extends SimpleApplication { |
||||
|
||||
@Override |
||||
public void simpleInitApp() { |
||||
// Create boxes with textures that are stored in the Android Resources Folders
|
||||
// Images are stored in multiple Drawable and Mipmap directories. Android picks the ones that
|
||||
// match the device size and density.
|
||||
Box box1Mesh = new Box(1, 1, 1); |
||||
Geometry box1 = new Geometry("Monkey Box 1", box1Mesh); |
||||
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); |
||||
mat1.setTexture("ColorMap", assetManager.loadTexture("drawable_monkey.png")); |
||||
box1.setMaterial(mat1); |
||||
box1.setLocalTranslation(-2, 0, 0); |
||||
rootNode.attachChild(box1); |
||||
|
||||
Box box2Mesh = new Box(1, 1, 1); |
||||
Geometry box2 = new Geometry("Monkey Box 2", box2Mesh); |
||||
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); |
||||
mat2.setTexture("ColorMap", assetManager.loadTexture("mipmap_monkey.png")); |
||||
box2.setMaterial(mat2); |
||||
box2.setLocalTranslation(2, 0, 0); |
||||
rootNode.attachChild(box2); |
||||
|
||||
PointLight pl = new PointLight(); |
||||
pl.setColor(ColorRGBA.White); |
||||
pl.setPosition(new Vector3f(4f, 0f, 0f)); |
||||
rootNode.addLight(pl); |
||||
|
||||
AmbientLight al = new AmbientLight(); |
||||
al.setColor(ColorRGBA.White); |
||||
rootNode.addLight(al); |
||||
} |
||||
} |
After Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 294 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 67 KiB |