SVG Loader Extension

  ... the SVG Extension for AndEngine.

Re: SVG Loader Extension

Postby Peacemaker » Fri Jul 15, 2011 11:38 pm

hi, is it possible to draw my own textures into more complex shapes (like stars and so on..)
Peacemaker
 
Posts: 19
Joined: Tue Jun 14, 2011 6:01 pm

Re: SVG Loader Extension

Postby dironto » Fri Jul 15, 2011 11:57 pm

Hi,
Yes, although I think that it is only one image per complex shape.
Regards,
Ronald
dironto
 
Posts: 65
Joined: Mon May 23, 2011 12:24 am
Location: Amsterdam, The Netherlands

Re: SVG Loader Extension

Postby Peacemaker » Sat Jul 16, 2011 12:23 pm

any idea how to do it? is it possible to fill star shape with square texture? Kinda cut it off? When I set drawprimitives = true and set texture to the star shape it doesnt draw texture but only coloured shape. Thanks.
Peacemaker
 
Posts: 19
Joined: Tue Jun 14, 2011 6:01 pm

Re: SVG Loader Extension

Postby Elday » Mon Jul 18, 2011 9:27 am

Hi,

How to use andenginesvgextension by eric for loading levels with latest andengine?

Now i have error:
Syntax: [ Download ] [ Hide ]
  1. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858): java.lang.NoSuchMethodError: org.anddev.andengine.opengl.texture.TextureFactory.createForTextureSourceSize 
  2. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.util.texture.TextureHolder.addTexture(TextureHolder.java:21) 
  3. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.SVGDoc.createTexture(SVGDoc.java:71) 
  4. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.node.BaseNode.createSprite(BaseNode.java:47) 
  5. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.node.BaseNode.createSprite(BaseNode.java:40) 
  6. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.node.RectNode.createShape(RectNode.java:35) 
  7. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.node.DrawablePhysicNode.create(DrawablePhysicNode.java:34) 
  8. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.node.RectNode.create(RectNode.java:26) 
  9. 07-18 10:31:23.596: ERROR/AndroidRuntime(1858):   at org.anddev.andengine.extension.svg.SVGParser.startElement(SVGParser.java:35) 
Elday
 
Posts: 3
Joined: Wed Jul 13, 2011 9:20 pm

Re: SVG Loader Extension

Postby cat555 » Tue Jul 19, 2011 1:07 pm

Hi Elday, the problem is that SVG Loader Extension has not yet been updated to accommodate the latest changes on andengine. There are methods that does not exist anymore, but SVG Loader Extension is trying to use... so, you have to use the andengine.jar that is present on the SVG Loader Extension examples project.

I think this is a problem, since there maybe important bug fixes on latest andengine, but we can't use it in SVG Loader Extension context... whoever is using this extension, is stucked to a previous andengine version, i think...

Regards,
Carlos V.
Regards,
Carlos V.
--
Check My Apps done with AndEngine:
cat555
 
Posts: 35
Joined: Fri Oct 22, 2010 4:28 pm
Location: Portugal

Re: SVG Loader Extension

Postby cat555 » Tue Jul 19, 2011 1:25 pm

Peacemaker wrote:any idea how to do it? is it possible to fill star shape with square texture? Kinda cut it off? When I set drawprimitives = true and set texture to the star shape it doesnt draw texture but only coloured shape. Thanks.


Hi Peacemaker, are you defining correctly the relative path to the image file? I think it must be relative to the project's assets path, and not relative to svg file path.
Regards,
Carlos V.
Regards,
Carlos V.
--
Check My Apps done with AndEngine:
cat555
 
Posts: 35
Joined: Fri Oct 22, 2010 4:28 pm
Location: Portugal

Re: SVG Loader Extension

Postby Peacemaker » Tue Jul 19, 2011 2:23 pm

cat555 wrote:
Peacemaker wrote:any idea how to do it? is it possible to fill star shape with square texture? Kinda cut it off? When I set drawprimitives = true and set texture to the star shape it doesnt draw texture but only coloured shape. Thanks.


Hi Peacemaker, are you defining correctly the relative path to the image file? I think it must be relative to the project's assets path, and not relative to svg file path.
Regards,
Carlos V.


ye that was the problem.. i had backslash in link instead of slash. Although. When i have square texture is there any way to fill it into nonsquare shape? So it kinda cuts off the square texture into nonsquare shape? Like this:

Image
Peacemaker
 
Posts: 19
Joined: Tue Jun 14, 2011 6:01 pm

Re: SVG Loader Extension

Postby cat555 » Tue Jul 19, 2011 3:36 pm

Peacemaker wrote:
cat555 wrote:
Peacemaker wrote:any idea how to do it? is it possible to fill star shape with square texture? Kinda cut it off? When I set drawprimitives = true and set texture to the star shape it doesnt draw texture but only coloured shape. Thanks.


Hi Peacemaker, are you defining correctly the relative path to the image file? I think it must be relative to the project's assets path, and not relative to svg file path.
Regards,
Carlos V.


ye that was the problem.. i had backslash in link instead of slash. Although. When i have square texture is there any way to fill it into nonsquare shape? So it kinda cuts off the square texture into nonsquare shape? Like this:

Image


Well, glad i could help you with that...

Regarding texture, i think i tested it some time ago, and the result was that the texture appeared like... a square... i'm not sure if it's possible what you are trying to achieve... have you tried to make a texture with exact complex shape, and transparent background?

Regards,
Carlos V.
Regards,
Carlos V.
--
Check My Apps done with AndEngine:
cat555
 
Posts: 35
Joined: Fri Oct 22, 2010 4:28 pm
Location: Portugal

Re: SVG Loader Extension

Postby Peacemaker » Tue Jul 19, 2011 4:13 pm

Creating exact shape would work. However im looking for an easy solution, cause im creating whole bunch of levels where i need to put texture in the ground ( grass or dirt ... and its kinda different in every level, cause its motorcycle like game ). What i want to achieve is similar to the game wheelz.
Peacemaker
 
Posts: 19
Joined: Tue Jun 14, 2011 6:01 pm

Re: SVG Loader Extension

Postby cat555 » Wed Jul 20, 2011 12:54 am

Hi, is there any property that we can use for set groupIndex fixture? I've tried to do this dynamically, but got exception... here is the code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     private void onLoadSVG(){
  2. ...
  3.         /*FixtureDef fd = new FixtureDef();
  4.         fd.filter.groupIndex = -1;*/
  5.        
  6.         FixtureDef fd = PhysicsFactory.createFixtureDef(1.0f, 0.0f, 0.1f, false, (short)0, (short)0, (short)-1);
  7.        
  8.         this.mBar = this.mSVGDoc.getElement("bar").getBody();
  9.         this.mBar.createFixture(fd); /*I'm getting NullPointerException here...*/
  10. ...
  11.         }
  12.  
Parsed in 0.012 seconds, using GeSHi 1.0.8.4


The idea is to set groupIndex on some bodies to -1, so i can avoid some collisions between some of the bodies.

Any ideas?

Regards + Thanks,
Carlos V.
Regards,
Carlos V.
--
Check My Apps done with AndEngine:
cat555
 
Posts: 35
Joined: Fri Oct 22, 2010 4:28 pm
Location: Portugal

PreviousNext

Return to SVG

Who is online

Users browsing this forum: No registered users and 2 guests