Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Does Shape:clear() remove stage objects too? — Gideros Forum

Does Shape:clear() remove stage objects too?

jack0088jack0088 Member
edited March 2012 in General questions
I have drawn multiple lines, added those to stage and after some time I cleared them again with Shape:clear() method. Are those objects gone from memory (garbagecollected) or are they still in the hierarchy tree (stage, etc.)?
cheers
jack0088
Owltwins. Smart design and creative code.
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!

Comments

  • Another question: When drawing a line path there are two ways of doing it:

    1) starting ONE SUBPATH (beginPath()) and lineTo() all points of the wanted path. multiple usage of lineTo:
    shape:beginPath()
    shape:moveTo( x1, y1 )
    shape:lineTo( x2, y2 )
    shape:lineTo(....)
    ...   
    shape:endPath()
    2) starting EACH TIME a NEW SUBPATH (beginPath()). so the whole path would be a set ob lines (subpaths). multiple usage of this code piece, over and over again
    shape:beginPath()
    shape:moveTo( x1, y1 )
    shape:lineTo( x2, y2 )
    shape:endPath()
    Is there any difference between this two methods? Theoretically there shouldn't be, right? Because the Points are needed anyway and the lines are just visual connectors.
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • ar2rsawseenar2rsawseen Maintainer
    edited March 2012
    shape object itself is still in hierarchy tree
    whar you did by using clear method is basically reset its size to 0, removing everything that was drawn with, object itself stays

    I guess yeah, there shouldn't be difference between multiple paths and single path. With multiple paths, you can set different colors, line width, alpha, etc for each path
  • @ar2rsawseen: ok, thank you very much!
    I made a testcase and it came out, you're right! :) thanks, it helped anyway!

    I'm working on a Class for making it easy to use geometrical shapes like lines, triangles, octagons, circles and more. It's not rocket science but veery helpful tool.
    I think it overloads my file when using Gideros beginPath, moveTo, lineTo... over and over again...
    Stay tuned, I'll post it soon - maybe today :)
    Owltwins. Smart design and creative code.
    »Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
  • Hmm - a while back I wrote an EMF file to flash converter, whereby the windows EMF / WMF file was "parsed" and turned into a bunch of flash - moveto, lineto commands. I'm wondering if there's any point in digging out the code and porting it across - it'd be interesting to see what Gideros does with the data.

    I should imagine that some of the more "complex" items might start to chug a bit, but if the render to texture feature ever appears it might be an interesting way to store resolution independent images ???

    Just my $0.02
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Sign In or Register to comment.