SVGTextureRegionExtension

  ... information about changes and new features of AndEngine,

Do you think the new SVGTextureRegionExtension is useful?

Fuck yeah!
51
85%
I don't know...?
8
13%
No!
1
2%
 
Total votes : 60

Re: SVGTextureRegionExtension

Postby ill2005 » Sat Oct 15, 2011 12:39 am

I am using Inkscape: Do I need to save the SVG files a special way? I've tried the default and the Optimized SVG.

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...
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void onLoadResources(){
  2. this.mBuildableBitmapTextureAtlas = new BuildableBitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
  3. SVGBitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
  4. this.mSVGTestTextureRegion = SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mBuildableBitmapTextureAtlas, this, "backgroundtest2.svg", CAMERA_WIDTH, CAMERA_HEIGHT);
  5.                
  6.                 this.mEngine.getTextureManager().loadTexture(this.mBuildableBitmapTextureAtlas);
  7. }
  8.  
  9. public Scene onLoadScene(){
  10. this.mScene = new Scene();
  11. this.mScene.setBackground(new SpriteBackground(new Sprite(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT, this.mSVGTestTextureRegion)));
  12. }
  13.  
Parsed in 0.032 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!

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. try {
  2.                         this.mBuildableBitmapTextureAtlas.build(new BlackPawnTextureBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(1));
  3.                 } catch (final TextureAtlasSourcePackingException e) {
  4.                         Debug.e(e);
  5.                 }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
ill2005
 
Posts: 22
Joined: Thu Sep 08, 2011 2:04 am

Re: SVGTextureRegionExtension

Postby fanno » Sun Feb 05, 2012 10:55 pm

i am not able to use inkscape at all, anyone have some help ???

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <path id="svg_1" d="m-0.76666,0.2l1.76666,318.8l318,0l-319.76666,-318.8z" stroke-width="0" stroke="#7f7f7f" fill="#7f7f7f"/>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

vs

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <path
  2.       d="M 0,0.02944006 0,32 31.97056,32.0893 z"
  3.       id="path3005"
  4.       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


how do i make it the right syntax ??? do i need a older version of inkscape ?

eg i would expect:
d="M 0,0.02944006 0,32 31.97056,32.0893 z"
to be
d="M0,0.02944006L0,32L31.97056,32.0893 z"

second it do not have the correct into on fill and such ?

it is in the style tag..

-Thanks
fanno
 
Posts: 3
Joined: Sun Feb 05, 2012 10:50 pm

Re: SVGTextureRegionExtension

Postby MJKT » Fri Mar 15, 2013 8:30 pm

Hello,

Could someone please re-upload the .jar file please?

This link no longer appears to be working and I can't seem to find it else where:
http://code.google.com/p/andengineexamp ... ension.jar

Thanks

EDIT: I found one within someone's andengine project:

Here you go

http://www.sendspace.com/file/wbahs8

EDIT:

Oh wait, everything is in github now - sorry I didn't see this before :oops:

https://github.com/nicolasgramlich/AndE ... nExtension
MJKT
 
Posts: 6
Joined: Thu Feb 07, 2013 11:17 pm

Re: SVGTextureRegionExtension

Postby programming.fanatic » Tue Apr 09, 2013 9:41 am

Nicolas, will it render SVG in bitmap format??
programming.fanatic
 
Posts: 58
Joined: Sat Feb 09, 2013 8:54 am

Previous

Return to Updates

Who is online

Users browsing this forum: No registered users and 4 guests