Jump to content
Search Community

General layout advice.

mrEmpty test
Moderator Tag

Recommended Posts

Hello.

 

This may not be appropriate for tis forum, so please feel free to kill it if needs be. This isn't specific to Greensock code, but this is a friendly forum and I feel happier asking this here.

 

After a few weeks of getting my head into AS3 and trying to ignore my iOS instincts, I'm ready to start coding my first big project. The GUI for it is quite simple, but I'm wondering the best way to go about coding it. So I thought I'd ask advice. I'm not looking for code examples, right now I'm thinking about it in a more general way.

 

The layout uses 3-4 layers with parallax, each layer has several elements on it, something like the ugly sketch attached.

 

The idea is that the user can swipe up/down and the GUI will navigate to the next/previous section. Parallax will be used to give a feeling of depth, many of the elements are partially transparent. Each element will come in and move out at it's own speed, initially based upon the speed of the user's gesture, which I'll give to throwProps.

 

I'm wondering if I should keep things simple by using a movie clip for each 'layer' and adding the appropriate parts to those movie clips, then using simple code to fake the parallax. Of if each item should be a separate movie clip which is driven directly?

 

Typing this out I think I'm making this too complex in my head, or probably not explaining it very well. It's hard to write down the complex motions these things need to do, the closest thing I can think of is parallax with dynamic velocities based off the gesture speed.

 

Anyway, tomorrow when I'm not really tired (long long day, started at 5am just finished) I'll probably sketch it up better. But if anyone has any thoughts, please let me know. And again, if this isn't a great place to ask, feel free to kill the thread.

 

Cheers.

Link to comment
Share on other sites

Hello.

 

Yeah, I tried out the assorted pre made stuff, I don't think it'll do what I want. The thing in my head I've discovered is more than just parallax, so I think I'll roll my own solution.

 

That's a lie, it's parallax but not the standard 'further away moves least' method, it's a mixed up bag. Ideally I'd like to throw in a display object, give it it a z order and a ration, and it'll take care of everything else. So I'll spend a couple of hours ripping apart, before probably starting from scratch!

 

This would all be so much fun if it wasn't for deadlines :)

Link to comment
Share on other sites

I kinda have it done, I have a very ugly class which needs some serious tidying when I get time. I create a parallax class like so:

 

private var aNewThing:Parallax = new Parallax(5, 1.1);

 

The arguments are the numbers of layers and the ratio. So this one for example has 5 layers, with each layer moving 1.1* the amount of the number I pass in, which I do by:

 

aNewThing.parallaxLogic(aNumberHere);

 

So you could, as I'm doing, pass in the Y location of a master movieclip.

 

So add stuff to the layers you simply use:

 

aNewThing.addLayerChild(yourMovieClipOrSprite, 2);

 

Which is the item you want to add, and the layer you want to add it to.

 

Like I say, it's ugly and needs work but for testing an idea it's ok. I can share if you want? I'd just need to strip out some stuff I can't release yet.

 

Attached is a SWF, I only added random content to the top panel as it were, but it shows the idea. I may add a blur based upon the layer, which tweens in and out when it's moving or stopped. This uses my parallax along with Jack's example code for iPad style flicking between pages combined with Throwprops to get that nice bouncy motion. I'm happy to share all the code, but please let me tidy it a little as it's an experiment and therefore a total disaster in terms of readability of cleanliness! It would be nice to share though so people can suggest ways to tidy it. :)

Link to comment
Share on other sites

Hey MrEmpty,

 

thanks for sharing that swf. it is VERY slick... although it took me a few seconds to figure out how to use it :)

 

if you ever get around to sharing the source, just be sure to not include any greensock membership plugins like throwProps.

 

 

for the others, please check out this nice example and just grab and flick up/down.

Link to comment
Share on other sites

Hello.

 

Thanks for the comments. The source won't include any member code, the parallax doesn't need it but the full example code will, so if people want to use it as is they'll need to purchase.

 

In terms of the parallax, the file is attached, feel free to use however you want and please make suggestions because the code will be so very poorly written. :)

 

EDIT: Oh, the new version which I'll upload soon has the iPad style bounce as shown on Jack's ThrowProps example. I'll upload a complete thing soon, but again if people wish to use as is they'll need to buy Jack's source.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...