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 Nicolas Gramlich » Mon Jun 13, 2011 7:45 pm

Hi guys,

sorry for the delay.
The sourcecode is now available!

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: SVGTextureRegionExtension

Postby Nicolas Gramlich » Mon Jun 13, 2011 10:14 pm

angel.ivorra wrote:Thank you very much man!!!! Great work.

I Uploaded the jar file.

https://rapidshare.com/files/3469143268/svgextension.jar
[Edit] http://code.google.com/p/andengineexamp ... ension.jar [/Edit]

Thanks man, i would try to make it work, and if i success o my task, i would post a tutorial.
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: SVGTextureRegionExtension

Postby angel.ivorra » Tue Jun 14, 2011 3:39 pm

Ok Nicolas, i had not seen the link in the web and i uploaded to the people doesnt know how to make the jar file... i've been playing with the extension and is great man!

Thank you for your great work!!
angel.ivorra
 
Posts: 37
Joined: Mon Mar 21, 2011 11:49 pm

Re: SVGTextureRegionExtension

Postby Nicolas Gramlich » Tue Jun 14, 2011 6:03 pm

angel.ivorra wrote:Ok Nicolas, i had not seen the link in the web and i uploaded to the people doesnt know how to make the jar file... i've been playing with the extension and is great man!

Thank you for your great work!!


No problem, I appreciated it. I had forgotten to add that link myself :)
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: SVGTextureRegionExtension

Postby dironto » Wed Jun 15, 2011 12:41 am

Hi Nicolas,

Again a great addition/extension! I am planning to make extensive use of this feature (and also the SVG extension of eric: http://www.andengine.org/forums/svg-extension/ as a level editor with inkscape. (Btw: both extensions share the same package)

However I do have a question or request: It would be great if it is possible to not set any size/width when creating the TextureRegion, but instead let it use the height/size of the svg image where we can set the scale.
So that my svg image of let's say 100x50 will be 'scaled' to 200x100 if I give only this as parameter:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. SVGTextureRegionFactory.createFromAsset(myTexture, getApplicationContext(), "svg/plant1.svg", 2); //2 = scale factor because user has high density screen.
  2.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


I know you can scale allready, just do not want to be set sizes of my svg images.. ;-)

Regards,

Ronald
Regards,
Ronald
dironto
 
Posts: 65
Joined: Mon May 23, 2011 12:24 am
Location: Amsterdam, The Netherlands

Re: SVGTextureRegionExtension

Postby Nicolas Gramlich » Wed Jun 15, 2011 3:58 pm

Hi,

I added constructors to SVGAssetTextureSource and SVGResourceTextureSource that take a "scale" parameter.

Changeset: http://code.google.com/p/andenginesvgte ... 8957458681

Hope that helped.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: SVGTextureRegionExtension

Postby dironto » Wed Jun 15, 2011 7:39 pm

Hi Nicolas,

Your change did help an it works for me! No need to specify width and height now.

Example code
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.textureSource= new SVGAssetTextureSource(pContext,  this.mPath,  scaleFactor); //phew, no width or height needed
  2. this.mTextureRegion = TextureRegionFactory.createFromSource(pTexture, this.textureSource, pBaseX, pBaseY);
  3.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


This is useful, because you do not need to specify all kinds of values in your code.

BTW: I am using a way where I do not even specify texture width/height in my code as well, it is calculated based on what's needed in a level. (and based on the "EasyTexture" thread, but with a blackpawn algorithm + some retries if it doesn't fit on the first attempt texture size)

So the approach is similar as BuildableTexture+BlackPawnTextureBuilder, but again I do not have to specify width/height of texture at front. (So if also BuildableTexture could work without specifying dimensions in the constructor... but I think that's is a differnt topic ;-)


anyway, thanks!
Regards,
Ronald
dironto
 
Posts: 65
Joined: Mon May 23, 2011 12:24 am
Location: Amsterdam, The Netherlands

Re: SVGTextureRegionExtension

Postby Mathew » Mon Sep 12, 2011 6:56 pm

Hello, this extension is great, but I have one problem.

My camera size is 720x480

Im using 1024x1024 image with strips, with rotation animation - which works well.

My problems comes after attempt to add next objects (for example image for button)

Log: Could not pack SVGAssetBitmapTextureAtlasSource (330x160

on this line by the way:

try {
this.mBuildableBitmapTextureAtlas.build(new BlackPawnTextureBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0));
} catch (final TextureAtlasSourcePackingException e) {
Debug.e(e);
}


I have really no idea what may be wrong, because if I set background with the same size like my camera (in this example 720x480, and then im adding new objects on scene, it works without any errors)

Please help me, thanks in advance!
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: SVGTextureRegionExtension

Postby Mathew » Wed Sep 14, 2011 9:16 am

My previous question has been fixed, user Obg1 helped me - thanks.

Simply my texture was to small.
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: SVGTextureRegionExtension

Postby gersh » Thu Sep 22, 2011 3:44 am

:lighbulb: The compressed SVG is about 1.5kB where the size of the images (png) is about 20kB. :exclamation:


Hi Nicolas,

Do you support compressed SVG?
I did some testing and I get an exception in the SVG parser when I try to load a compressed SVG (from Inkskape - both Compressed plain and compressed Inskape and svgz from PhotoShop).

The SVGTextureRegion example took 55 seconds to load on my HTC Legend, is that normal or am I missing something?

Cheers
gersh
 
Posts: 32
Joined: Tue May 10, 2011 5:33 am

PreviousNext

Return to Updates

Who is online

Users browsing this forum: No registered users and 4 guests