1 Reply Latest reply on Dec 17, 2010 9:00 AM by audrey10136

    XFL DOMShape parser.

    julapy

      hi,

       

      i've been taking advantage of the new XFL file format recently and it's really opened up a lot of possibilities!

      i've started a C++ project which parses and builds XFL files as a addon for openFramworks

      here is the project on github => https://github.com/julapy/ofxFlash

       

      im now up to the point where i need to work out how to parse the content of DOMShape so I can draw custom shapes.

      im finding that online docs on this topic are non-existant.

       

      i need to understand how Edge is being encoded - example XFL snippet below,

       

      <edges>
          <Edge fillStyle1="1" edges="!18240 15000/15240 13960!15240 13960/14320 11200!14320 11200/18240 12200!18240 12200/18240 15000"/>
          <Edge cubics="!18240 12200(;18240,12200 18240,15000 18240,15000p18240 12200 18240 15000);"/>
          <Edge cubics="!15240 13960(;15240,13960 14320,11200 14320,11200q15240 13960 14320 11200);"/>
          <Edge cubics="!14320 11200(;14320,11200 18240,12200 18240,12200q14320 11200 18240 12200);"/>
          <Edge cubics="!18240 15000(;18240,15000 15240,13960 15240,13960q18240 15000 15240 13960);"/>
      </edges>

       

       

      any pointers or links would be immensly appreciated.

       

      thanks,

      L.

        • 1. Re: XFL DOMShape parser.
          audrey10136

          I know that if I trace a 300x250 square shape at x:0 y:0 , the value of edges is :

          !6000 5000|0 5000!0 5000|0 0!0 0|6000 0!6000 0|6000 5000

           

          So 300*20 = 6000 and 250*20 = 5000.

          Seems to be x20.

           

          If your shape is not a square i'm not sure how that works, but

          that should give you an idea !