Thinkscroller - Pixel-perfect parallax scrolling

Discussion in 'Assets and Asset Store' started by Thinksquirrel, Sep 27, 2011.

  1. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    [​IMG]

    Thinkscroller is an easy-to-use utility for 2D parallax scrolling.







    [​IMG]

    Here are just a few features:
    • Automatic pixel-perfect support (just set a toggle)
    • Size controls and stretch mode
    • Multi-axis scrolling (horizontal, vertical, or both - can be used in any orientation as well)
    • Automatic mesh and material generation - just drag and drop an image onto the scroll layer
    • An easy to use automatic parallax weight system. Just drag and drop - great for mobile games!
    • Example scene, with scripts for parallax movement based on a transform, as well as automatic movement are included
    • Hooking the system into your own script is as easy as one line: Parallax.Scroll(Vector2 scrollValue)
    • Parallax layers are separate from Unity's layer system, allowing the system to work with even the most complex camera setups
    • Custom editors for all components
    • Full, documented source code
    • One draw call per parallax layer

    For power users, Thinkscroller supports custom billboards, scrolling multiple textures per material. It also features a full, robust API:

    http://thinksquirrel.com/docs/thinkscroller/reference

    Thinkscroller is available on the Asset Store:
    http://u3d.as/2kQ

    Let me know if you guys have any questions =)
    Last edited: Aug 12, 2013
  2. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
  3. hxx2010

    hxx2010

    Member

    Joined:
    Aug 31, 2009
    Messages:
    155
    You can trigger collision´╝č
  4. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Currently there is no collision with the parallax layers themselves - the idea would be to use the parallax layers as repeating background and foreground layers, and have the collision on the main layer with your game characters and obstacles. With good object placement you can have collision objects that move by at the same speed as an object in a parallax layer when your character is moved.
  5. cheezorg

    cheezorg

    Member

    Joined:
    Jun 5, 2008
    Messages:
    376
    Looks cool, might come in handy for a project I have coming up!

    Quick question before digging into the docs - In your demo the scene appears endless; are the repeating textures automatically generated by Thinkscrolller?

    EDIT: Oops! Just saw "Automatic mesh and material generation."

    I guess my next question would be if it's possible to NOT generate the material automatically, or even better - to be able to create a set of 3 different textures for a layer, and have them randomly selected by the generator - to allow more randomized level creation.
    Last edited: Sep 28, 2011
  6. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    The textures themselves are pngs (or any other file) created in any image editing program - Thinkscroller will automatically scroll and repeat all of the textures when you use the method Parallax.Scroll(Vector2).

    Here's an example script that scrolls based on the transform of an object.

    http://thinksquirrel.com/docs/think...rallax_a2391ff0bbb3c328f7b33d25aff32f5f5.html

    Custom materials are supported - you can either automatically generate the mesh and change the material, or create a custom billboard mesh and reference that.

    I'll add a SetMaterial() call into the API - this will allow you to easily make a script to add a random material to the layer.
    Last edited: Sep 28, 2011
  7. cheezorg

    cheezorg

    Member

    Joined:
    Jun 5, 2008
    Messages:
    376
    Very cool!
  8. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Just wanted to say that I've added the SetMaterial() method, as well as advanced settings (for power users):

    [​IMG]

    These should be available on release.
    Last edited: Sep 29, 2011
  9. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Thinkscroller has been released on the Asset Store:

    http://u3d.as/2kQ

    Hurry now while it's still on sale!
  10. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    If you've purchased Thinkscroller, please feel free to leave feedback or suggestions here, and don't forget to rate it on the Asset Store!
  11. giyomu

    giyomu

    Member

    Joined:
    Oct 6, 2008
    Messages:
    1,039
    Hello !

    and thanks for your little tool,

    few things by the way , I am not sure but is there a way to get a per layer scroll direction , as i can see everything seem to be done from the manager but in the case you want have some of the layer scrolling in a different direction than other..?

    also , the auto mesh generation seem to create all time a plane conforming to fill screen size , problem with that is if you get a rich foreground or even background with texture that let a lot of transparent area , you get killed very fast by fillrate on mobile ( as an example your example 2 on 4g do not run more than 20 fps as opposite of the 60 you get in example 1 , due to far less layer on top of each other).

    would be more cool if the auto mesh could cut just regarding texture size and then fit this in some way to screen ( like if i get a 960 * 100px texture it do not fill up like a 960 * 640 texture ).

    ah and also one last things , in your scene there is a parallax default mat on object , is this dynamically generated , cause i cant spot it in project nor the shader related to it.

    thanks !
  12. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Currently, I only have one scroll direction. I'll put in some modifiers per layer - I'm thinking an x and y multiplier that can be applied on each layer (that can also be negative).

    As far as the billboards - cutting the meshes to fit the texture is definitely a high priority (I'll try to get it into the next version as well). For right now, I would recommend using a custom billboard mesh with an Unlit shader. The default parallax shader is generated through code in the _ScrollLayer script - If you copy it from there, you should get the same behavior on any billboard.

    Thanks again for the feedback!
  13. Diegoale2000

    Diegoale2000

    Member

    Joined:
    Sep 16, 2008
    Messages:
    65
    You know, it would be great if this had support for something like 2d Toolkit.
  14. thylaxene

    thylaxene

    Member

    Joined:
    Oct 10, 2005
    Messages:
    645
    Yes I'd like to see support for other 2D kits as well. My preference would be ex2D.
  15. giyomu

    giyomu

    Member

    Joined:
    Oct 6, 2008
    Messages:
    1,039
    To use 2d toolkit, then i guess using static spite batch to make your scroll sheet, and use as many as needed for parralax, then instead of using texture just use the object itself to be translated, I am already do this on one game i am doing, and kept a scroll texture for the sky whre it fill up entire screen, so hmm if the system could accept object for parrallax it will allow to use whatevr you want...
  16. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Just implemented the scroll speed modifier, and currently working on mesh clipping.

    I'll take a look at integration with 2D toolkit/ex2D. I can make object parallax layers that scroll a game object and it's children, as well.
    Last edited: Oct 10, 2011
  17. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    1.0.5 has just been submitted. It brings mesh clipping, tile settings, and offsets, among other things. I'm still working on support for ex2D, 2DToolkit, etc - that should be available with 1.1.

    The price will currently stay the same, but will raise with version 1.1.

    [​IMG]

    Full changelog:

    ******** VERSION 1.0.5 ********
    Note: All negative scales need to be flipped, or textures may appear backwards.

    Thinkscroller:
    * Added advanced pixel perfect features (cropping, tiling)
    * Added pixel fix offset for floating-point error compensation
    * Fixed scale bug (scales were negative)
    * Added API calls for all of the above

    Example project:
    * Added cropped textures and cropped example scene
    * Bug fixes
    Last edited: Oct 10, 2011
  18. altair2020

    altair2020

    New Member

    Joined:
    Mar 6, 2011
    Messages:
    21
    Hi,

    Do you require Unity Pro to use this ?

    Thanks.
  19. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    This should work just fine with Unity Indie. Let me know if you run into issues.
  20. moctezumagames

    moctezumagames

    New Member

    Joined:
    Jun 9, 2009
    Messages:
    395
    looks really good! Many 2D game makers needed this for Unity.
  21. juicymangoz

    juicymangoz

    Member

    Joined:
    Nov 30, 2009
    Messages:
    336
    Hi
    I use Sprite Manager to create my objects - can I use this to create the elements for the scrolling scene?
  22. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Hello mangoblue,

    This is being developed for the next update - object scrolling will offer scroll functionality for any GameObject.
  23. juicymangoz

    juicymangoz

    Member

    Joined:
    Nov 30, 2009
    Messages:
    336
    Okay thanks - when's the next update out?
    Cheers
  24. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Hoping to have 1.1 ready for testing next week and for submission soon after that.
  25. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Scratch that - Found some time today and finished the implementation.

    I've sent some PMs to a few users regarding testing 1.1. If you would like to beta test, send me a PM with the invoice # from the asset store, and I'll get the package for you. =)

    Here's the changelog:

    ******** VERSION 1.1 ********
    Thinkscroller:
    • Separated the default shader from the ScrollLayer script
    • Added Object Layers! Disable Auto Billboards and enable "Object Layer"
      • Object Layers scroll the transform and ignore any textures on the object
      • They can also scroll groups of objects, and work with physics
      • Fully compatible with most sprite/2D game management systems
      • Object Layers scroll in world space (relative to the parallax camera), as opposed to UV space
      • Object Layers can also be enabled and disabled through the API using the isObjectLayer property
    Last edited: Oct 20, 2011
  26. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Version 1.1 has been submitted and should be released shortly!

    Also, some good news: I have also decided to keep the product at its introductory price, $20.
  27. megmaltese

    megmaltese

    Member

    Joined:
    Mar 19, 2009
    Messages:
    1,897
    Access denied. You may need to login below or register to access this page.
  28. rstehwien

    rstehwien

    Member

    Joined:
    Dec 30, 2007
    Messages:
    101
    Thinkscroller can't be found in the asset store and the link given on the first page doesn't work. Hope the asset store gets fixed so I can buy this at the $20.
  29. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    The Thinksquirrel.com website should be working now, it had a hiccup earlier. Let me know if you're still getting access denied errors.

    My apologies,

    I've contacted the Asset Store team. Hopefully everything will be sorted out within a few days.
  30. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Thinkscroller is back up on the Asset Store, and version 1.1 has been released.
  31. thylaxene

    thylaxene

    Member

    Joined:
    Oct 10, 2005
    Messages:
    645
    Thanks v1.1 is a nice update.

    I'm using Object Mode with 2D Toolkit and all seems happy. One feature request for Object Mode is to have a reset method to call. Eg:

    Parallax.ResetAllObjects(Vector2.zero);

    or

    Parallax.ResetAllObjects();

    which just resets the X and Y of the Objects to their start X and Y.

    I can easily do it with Tags and looping through a GameObject[]. But as I'm already using Thinkscroller and calling "Parallax" for others things it would be convient to have a Object Reset call every time I restart a level of the game.

    Cheers.
  32. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Just sent you a PM with a pre-release patch - let me know how that works out! I'll include this along with some minor bugfixes for the next release.
  33. Pr3Z

    Pr3Z

    New Member

    Joined:
    Oct 25, 2011
    Messages:
    5
    While I really like the tool, I've found that it's almost doubled my loading time for my app and the ram use on my android phone has jumped from about 60mb to almost 120mb. :/
  34. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Hm... I'll check this out - sounds like something's leaking. Are you using the default setup or object scroll layers?
  35. Pr3Z

    Pr3Z

    New Member

    Joined:
    Oct 25, 2011
    Messages:
    5
    I'm using a scroll layer, and it's the only thing I have parallaxing. It's set up just as it was in the example except I'm using the ScrollWithTransform so that the layer will parallax with my character.
  36. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Hm. I'm unable to track this down - wondering if it's a device issue.

    The mesh is only updated once on Awake (or just loaded if that's turned off) - I'm wondering if SetTextureOffset() is causing some unnecessary allocation. Try this checklist:

    1) If you're using the textures from the Asset Store package, make sure they're compressed in the texture import settings - the default project doesn't use compressed textures.
    2) Try disabling the main parallax component to see if memory usage still increases.

    Also, what device are you using? And is this memory increase over a period of time or only on load?
  37. Pr3Z

    Pr3Z

    New Member

    Joined:
    Oct 25, 2011
    Messages:
    5
    It's a Samsung Galaxy S, no increases over time from what I can see. I'll check out the texture thing now and report back :)
  38. Pr3Z

    Pr3Z

    New Member

    Joined:
    Oct 25, 2011
    Messages:
    5
    Definitely had to do with the texture compression, not sure as to why it nearly doubled my ram usage though. Interesting. Thanks for the fix man!
  39. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    No problem, and good to hear! I'll make sure it's compressed by default for the next version, as other people may run into that issue.
  40. Pr3Z

    Pr3Z

    New Member

    Joined:
    Oct 25, 2011
    Messages:
    5
    Awesome to hear :) I also have a question about the Parallax manager script. When I hit "replay" at the end of my game, the level is reloaded, but each time it reloads a new Parallax Manager spawns? Just wondering if there's a way to avoid this.
  41. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    This was a bug that should be fixed in the latest version (not on the Asset Store yet) - I've sent a link through PM.

    If you're creating the manager through script, you'll need to call Parallax.CreateManager(). Otherwise, everything should just work automatically.
  42. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    1.2 has been submitted to the Asset Store and should be released soon.

    Thinkscroller Changelog

    ******** VERSION 1.2 ********
    Thinkscroller:
    * Got rid of Thinksquirrel Common Libraries dependency. You can safely delete the Thinksquirrel Common folder and TSInspectorBase class.
    * Fixed an issue with the Parallax Manager being created more than once.
    - If you are creating a parallax manager from a script, make sure to call Parallax.CreateManager() before accessing any static functions!
    * Fixed an issue with non-pixel perfect textures not working
    * Added UV padding

    Example project:
    * Textures are compressed by default

    If you purchase Thinkscroller, don't forget to rate the package! Any and all feedback is appreciated.
  43. buagaga

    buagaga

    New Member

    Joined:
    Feb 10, 2012
    Messages:
    1
    Hi

    I'm very interested in this tool.
    Is there version 1.2 available?
  44. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Hello, and thanks for your interest!
    Version 1.2 is currently submitted under review and should be in the Asset Store within the next few days. If you've purchased Thinkscroller, send me an invoice number through PM and I can get it to you early.
  45. ggaller

    ggaller

    New Member

    Joined:
    Feb 14, 2012
    Messages:
    2
    Hi.

    I'm trying to use 2D Toolkit with ThinkScroller. I'm creating new sprite from my sprite collection and adding Scroll Layer component to it. Check "Object Layer" and run game. Sprite is moving, but not repeated.

    What i'm doing wrong?
  46. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Object Layers only scroll the transform of an object - you'll need to either handle tiling your sprite with 2D Toolkit, or use a standard scroll layer.
  47. ggaller

    ggaller

    New Member

    Joined:
    Feb 14, 2012
    Messages:
    2
    Thank you for the fast reply.
  48. GabeG

    GabeG

    New Member

    Joined:
    Jan 21, 2012
    Messages:
    11
    Hello,

    I read through the posts and noticed that people are using the scroll with transform script for a "parallax" effect while the camera follows the player. Could anyone help me with setting this up? Ive tried applying it to the camera and or mesh and no luck. I am scripting illiterate as im an solely an artist so any help would be appreciated.
  49. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    You'll want to put the ScrollWithTransform script on the player, rather than the camera or scroll layer.
  50. Thinksquirrel

    Thinksquirrel

    Member

    Joined:
    Feb 8, 2011
    Messages:
    902
    Currently working on the next release, to be submitted shortly.

    NOTE: This will upgrade the current version of the common libraries, move some folders around, and will change the Thinkscroller namespace to ThinksquirrelSoftware.Thinkscroller to match Thinksquirrel coding standards, and keep compatibility with other Thinksquirrel Software products.

    To upgrade:
    1. Back up your project. Open the project and close all open scenes.
    2. Completely remove the Plugins/Thinkscroller, Plugins/Thinksquirrel Common, and Editor/Thinksquirrel Software folders.
    3. Install the new version from the Asset Store.
    4. Change the Thinkscroller namespace in your scripts to ThinksquirrelSoftware.Thinkscroller

    Other than the namespace change, the API won't change at all. Sorry for the inconvenience!