SVG Loader Extension

  ... the SVG Extension for AndEngine.

Re: SVG Loader Extension

Postby Giszmo » Thu Mar 31, 2011 5:59 pm

I found out that all Elements I get are Rectangles and now I use Rectangles of different colors for my entities and managed to load some meaningful data. A bit annoying is the big dependency, but maybe I add box2d-stuff anyway.
For now the weird coordinates are bugging me. In inkscape I somehow don't see the correlation between the coordinates inkscape shows me and those written to the svg.
FluxCards allows you to learn 20 words per day with only 15 minutes repeating per day. Try it out. It's free and amazing ;)
Image Image
Giszmo
 
Posts: 113
Joined: Thu Mar 03, 2011 11:07 pm

Re: SVG Loader Extension

Postby Giszmo » Thu Mar 31, 2011 7:47 pm

... now I'm happy with what I get and can start creating levels :) I'm not bothering to find out what coordinates translate to what as long as the relative coordinates are consistent. Thanx again.
FluxCards allows you to learn 20 words per day with only 15 minutes repeating per day. Try it out. It's free and amazing ;)
Image Image
Giszmo
 
Posts: 113
Joined: Thu Mar 03, 2011 11:07 pm

Re: SVG Loader Extension

Postby eric » Sat Apr 02, 2011 9:39 am

Sounds good :)
No problem for help.
And good luck with ur game.
eric
 
Posts: 44
Joined: Wed Feb 16, 2011 9:53 pm

Re: SVG Loader Extension

Postby josejps84 » Wed Apr 20, 2011 2:05 pm

Hi eric,

I'm a very new andengine developer, I'm trying to do a game where users can edit their avatar when they register, I'm looking for options to do this in an easy way and I saw your extension very interesting but until now I've never seen SVG format in depth, just comments, so I have a couple of questions, In my SVG graphic can I edit the colors of skin and clothes ? and the other, Can I use svg graphics as AnimatedSprite somehow ?

Greetings

PD: Sorry about my bad english ;)
josejps84
 
Posts: 5
Joined: Wed Apr 20, 2011 3:24 am

Re: SVG Loader Extension

Postby eric » Wed Apr 20, 2011 2:38 pm

Hi.

The svg importer is mainly designed to import sprites and physics.
If u give it an file it will import it and turn it into sprites and bodies.
If u plan to have a vector charchter it will maybe be tricky to apply color changes.
And u cant save the result as svg.
U have to store the color data and apply them every time u load the charchter.

What i try to say is that the svg extension does not allow u to manipulate the svg.
It simply creates sprites, shapes and bodies so u can use and manipulate them.
If u have complex shapes (curved) it creates many tringle shapes in a parent shape.

So u can use the svg extension for that but it could be a bit tricky :)
Sorry about my english too ;)
eric
 
Posts: 44
Joined: Wed Feb 16, 2011 9:53 pm

Re: SVG Loader Extension

Postby Giszmo » Wed Apr 20, 2011 2:46 pm

The idea of the SVG Loader Extension basically is to get a physics sandbox setup all with colors if you need.
I misuse it to not directly load physics or graphical objects but to get a list of rectangles with sizes, orientations and colors that I then can interpret and translate into entities like friends, foes, bases, NPCs etc.
SVG-writing is not part of this project as far as I can see, so no idea if it helps you in any way. Also if you intend to let your customers create SVGs that they then can load into the game, I doubt this extension is for you as it requires custom properties a normal SVG-editor will not provide.
FluxCards allows you to learn 20 words per day with only 15 minutes repeating per day. Try it out. It's free and amazing ;)
Image Image
Giszmo
 
Posts: 113
Joined: Thu Mar 03, 2011 11:07 pm

Re: SVG Loader Extension

Postby josejps84 » Wed Apr 20, 2011 7:57 pm

Thanks for your replies, now I understand what SVG files and the plugin do, and now I've got another question, Can I have all character animation tiles in one SVG file, change "parameters" like colour and then take it into an AnimatedSprite ?

My intention is that an character have its own properties like colour as an external parameter, all the animations stored in an svg file and merge them in an AnimatedSprite, Is this posible ?

Greetings
josejps84
 
Posts: 5
Joined: Wed Apr 20, 2011 3:24 am

Re: SVG Loader Extension

Postby eric » Thu Apr 21, 2011 9:38 am

Not in game.
In svg u can only link a animated sprite which would look like this:
andengine-animation-duration="3000,30,50,30"
andengine-animation-endtile="3"
andengine-animation-starttile="0"
andengine-has-animation="true"
andengine-tilerows="1"
andengine-tilecols="4"
andengine-spritetype="2"
andengine-spritesrc="gfx/PacMan_tiled.png"

U could load sprites in all varieties and disable not used sprites and textures.
This could be memory expensive so it needs to be done carefully.
eric
 
Posts: 44
Joined: Wed Feb 16, 2011 9:53 pm

Re: SVG Loader Extension

Postby josejps84 » Thu Apr 21, 2011 12:48 pm

Ok I've got it , thanks a lot eric
josejps84
 
Posts: 5
Joined: Wed Apr 20, 2011 3:24 am

Re: SVG Loader Extension

Postby eric » Thu Apr 21, 2011 1:59 pm

No Problem. :)
eric
 
Posts: 44
Joined: Wed Feb 16, 2011 9:53 pm

PreviousNext

Return to SVG

Who is online

Users browsing this forum: No registered users and 2 guests