flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Sprite Auto Alignment
Date Sat, 23 Nov 2013 00:00:53 GMT
Sometimes, an additional constraint or two can make the problem much
easier to solve.

I thought you could run C# code in the browser wrapper and not involve the
server.

-Alex

On 11/22/13 11:54 AM, "Jake Churchill" <reynacho@gmail.com> wrote:

>Alex,
>
>Yes, there are constraints but they are dynamically generated.  The app is
>a web app but I'm trying really hard not to involve the server for this.
>
>Thanks!
>
>-Jake
>
>
>On Fri, Nov 22, 2013 at 1:19 PM, Alex Harui <aharui@adobe.com> wrote:
>
>> It isn't clear that the "fast" algorithm will always return the best
>> possible result. You may have to make some trade-offs of algorithm
>> complexity, compute time, and quality of the results.
>>
>> Are there other constraints on the problem-space that might make it
>>easier?
>>
>> Is this a web app?  If so, you might be able to run the C# code via
>> ExternalInterface.
>>
>> -Alex
>>
>> On 11/22/13 11:06 AM, "Jake Churchill" <reynacho@gmail.com> wrote:
>>
>> >The problem with a treemap is it fills up the entire space.  I need it
>>to
>> >not do that.  The problem with the codeproject that Lee mentioned is
>>it's
>> >all C# and while I'm sure I can re-write it to AS3, I'd prefer not to
>>have
>> >to.
>> >
>> >-Jake
>> >
>> >
>> >On Fri, Nov 22, 2013 at 11:55 AM, Jesse Ward-Karet <jwk@tanium.com>
>> wrote:
>> >
>> >> Consider treemap algorithms. There are a couple links to academic
>>papers
>> >> on the subject and a cool real world implementation here:
>> >>
>> >> http://windirstat.info/background.html
>> >>
>> >>
>> >> > On Nov 22, 2013, at 9:40 AM, Lee Burrows
>> >><subscriptions@leeburrows.com>
>> >> wrote:
>> >> >
>> >> > isnt google amazing!
>> >> >
>> >> >
>> >>
>> >>
>> 
>>http://www.codeproject.com/Articles/210979/Fast-optimizing-rectangle-pack
>> >>ing-algorithm-for-bu
>> >> >
>> >> >> On 22/11/2013 17:35, Jake Churchill wrote:
>> >> >> Guys,
>> >> >>
>> >> >> I'm working on a project with a component that displays child
>>sprites
>> >> of different sites and allows the user to arrange them.  The sprites
>>are
>> >> all rectangles of different sizes.
>> >> >>
>> >> >> What I'm trying to do is create an auto-align which will crunch
>>the
>> >> children down into the smallest possible arrangement.
>> >> >>
>> >> >> I'm wondering if anyone has heard of or has some kind of logic
>>that
>> >> would help with this.  FYI, I'm not looking for a handout.  I've
>>already
>> >> gone through 2 different iterations of the logic and each has a bug
>> >>once in
>> >> a while.
>> >> >>
>> >> >> Where I run into issues is when I have one really tall sprite and
>>a
>> >> bunch of shorter ones.  I get things aligned in a single row and then
>> >> create another row on top and start lining up the additional ones,
>>but
>> >> really what should happen is I should have the larger sprite have a
>> >> "rowspan" like you can with html tables.
>> >> >>
>> >> >> I've attached an illustration from the app.  The top 2 images is
>> >>start
>> >> and after the auto align.  This works well when the sprites are about
>> >>the
>> >> same size.  The 2nd row is what happens with a taller sprite and much
>> >> smaller sprites, and finally below is what I would like to have
>>happen
>> >>but
>> >> am having issues getting there.
>> >> >>
>> >> >> Any help would be awesome.
>> >> >>
>> >> >> Thanks!
>> >> >>
>> >> >> -Jake
>> >> >
>> >> >
>> >> > --
>> >> > Lee Burrows
>> >> > ActionScripter
>> >> >
>> >>
>>
>>


Mime
View raw message