Loading Textures with the TGALoader

Hi



I get an image back from the TGAloader, how can i get a texture from the image?



[java]Image img = TGALoader.load(new FileInputStream(new File(“C:/texture.tga”)), true);

Texture tex = …;

tex.setImage(img);

[/java]



I’m new on JME plz help me :wink:



obi48

http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/snippets/single/14/

wtf are you doing there obi? Did you read the tutorials at all? You’re not supposed to use the loader directly, you load stuff via the assetManager.

You should definitely go through the whole starter tutorial series, but here’s what you’re looking for. https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset#loading_textures

Thx for your help!



I thought i need a texture (tga), but the textureinformations are in ogrexml/j3o too.

srry for my post :wink:



finally it runs^^