When I try to load an SVG as a sprite background, it doesn't work.. I get a blank black background instead. No exception is thrown, but the AndEngine log output is:
Unexpected SVG tag: 'metadata'.
Unexpected SVG tag: 'RDF'.
Unexpected SVG tag: 'Work'.
Unexpected SVG tag: 'Format'.
Unexpected SVG tag: 'type'.
Unexpected SVG tag: 'title'.
Here is my relevant code, if it helps...
Using java Syntax Highlighting
- public void onLoadResources(){
- this.mBuildableBitmapTextureAtlas = new BuildableBitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
- SVGBitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
- this.mSVGTestTextureRegion = SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mBuildableBitmapTextureAtlas, this, "backgroundtest2.svg", CAMERA_WIDTH, CAMERA_HEIGHT);
- this.mEngine.getTextureManager().loadTexture(this.mBuildableBitmapTextureAtlas);
- }
- public Scene onLoadScene(){
- this.mScene = new Scene();
- this.mScene.setBackground(new SpriteBackground(new Sprite(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT, this.mSVGTestTextureRegion)));
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Thanks in advance!
[EDIT] I edited the .svg in notepad and removed the metadata section. The AndEngine log no longer says anything, but the background is still just blank (black).
[SOLVED!] When using a BuildableBitmanTextureAtlas you need to build the atlas before attempting to load the texture!
