Search Unity

SpriteTile, a fast dynamic tile system (RELEASED)

Discussion in 'Assets and Asset Store' started by Eric5h5, Dec 11, 2013.

  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You could use a layer as I mentioned, though it sounds like it would be a good idea to have a matching SetColliderTag function. As for custom data, you could use trigger numbers for that (Get/SetTrigger). The tile types are the set and tile numbers for any given tile; the Acorn Antics demo has an example of using GetTile to see when it's hitting spike tiles.

    --Eric
     
  2. Stoven

    Stoven

    Joined:
    Jul 28, 2014
    Posts:
    171
    Hey Eric5h5! I've purchased your product some time ago and I must say its a very nice Asset!

    Its really awesome to be able to easily construct layered levels from tiles =)

    There are a few things I want to do, and I was hoping you could help steer me in the correct direction since I'm still quite new to using Unity!

    Is there an easy way to dynamically assign the level Game Object Transforms (Layers and Colliders) to a parent object without having prior knowledge of the Map Data for the level?

    If not, do you think you could help me better understand the Source Files so I can make a utility function to do this for my levels?

    Thank you!
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Thanks! I'm not quite sure I understand the question; what is it that you're attempting to do?

    --Eric
     
  4. Stoven

    Stoven

    Joined:
    Jul 28, 2014
    Posts:
    171
    Well I want to keep my scenes organized. I was hoping to add the GameObjects generated by Tile.LoadLevel to a Game Object dynamically. For example, to an NGUI UI Root -> Viewport GameObject, or to some GameObject that acts as a container for 'visual' objects in the scene. Specifically, I want to assign the Level information to a parent object as soon as LoadLevel is called.

    The problem is I'm not sure how I can do this for all cases of Tile levels. They'll have differing layers, and I'm not sure if I can do something like get GameObjects based on their string name. Even if I could, it would feel like a sloppy fix to try to use that method.

    I've looked into the Source Files and there may definitely be a way for me to get the data and assign it to a GameObject on a call to Tile.LoadLevel, but I can already tell it'll take me awhile to understand the source code so I'm hoping you could help me out =)

    If there's a better way of doing this without having to use Sprite Tile source code, please let me know.

    If you don't recommend doing something like this, please explain why its a bad idea. Thanks!
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well, each layer has a single parent container object that holds all the tiles, and all physics colliders are also parented to a single container object, so to me that already seems about as well-organized as it can get...I'm not sure what benefit there would be in parenting those to additional objects. The tile GameObjects themselves are pooled objects so there's no point accessing them individually; they aren't tied to any specific tile and will change if the camera is moved far enough. The way to interact with SpriteTile at runtime is to use functions such as GetTile and so on.

    --Eric
     
  6. Stoven

    Stoven

    Joined:
    Jul 28, 2014
    Posts:
    171
    So if I want to have my screen scaled to a Viewport handled by NGUI I should call the appropriate Tiles with GetTile commands?

    I want the Tiles to be scaled by NGUI's UI (I should have been more clear about this in my initial posts, sorry!!!) and was wondering if its okay to have the Tiles scaled according to the UI's constraints.

    Sorry about these nooby questions. I just really like Sprite Tile and I want to continue using it with my project, I'm just a bit worried that I may not be able to use these two Assets together the way I had originally thought.
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I don't know how NGUI works, but SpriteTile objects are not meant to be managed by anything other than SpriteTile and I expect it will break if other scripts interfere with them. You can use multiple cameras with SpriteTile, which may or may not help depending on what you're trying to do.

    --Eric
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, dummy! The correct answer was "Sometime this month, for sure."

    SpriteTile 2.3

    Additions:
    • Tile.SetMapTileset, for changing an entire map to a given tileset. Useful for things like day/night changes when you have two (or more) tilesets that are different versions of the same thing.
    • Tile.GrabSprite, which gets a tile from a specified position and converts it into a sprite GameObject which can then be moved around independently.
    • Tile.PutSprite, which puts a grabbed sprite back into the level as a tile.
    • Tile.GetMapBlockBytes, which gets a byte array from a map block, which can be used to save a section of a layer.
    • Tile.LoadMapBlock, for loading a layer as a MapData block. So GetMapBlockBytes and LoadMapBlock, along with GetMapBlock and SetMapBlock, could be used to make a level paging system for example.
    • Tile.SetColor, for making a particular tile a specified color.
    • Tile.SetColorBlock, for making a defined area a specified color.
    • Tile.GetColor, which returns the color of a particular tile.
    • Tile.UseTrueColor, for making SpriteTile use 8-bit per channel color. The default is 4-bit per channel, which works in most cases since per-tile colors don't usually need fine control over color. This allows colors to use 2 bytes per tile, whereas truecolor uses 4 bytes per tile.

    Changes:
    • Tile.SetCamera can be called subsequently with different cameras without causing an error.

    Fixes:
    • Tile.SetMapBlock works if the block is placed so that the topmost or rightmost edges of the block align with the topmost or rightmost edges of the map.
    • Fixed potential tile animation glitch that could occur in certain cases such as zooming the camera.

    TileEditor Additions:
    • Tiles that use physics colliders can have customized polygon colliders, in addition to the standard auto-generated colliders.
    • A trigger number can be set as a default for each tile, in the same way as defaults for rotation and order-in-layer. When drawing with a particular tile, the associated default trigger will be set along with the tile (as long as the default isn't 0).

    TileEditor Changes:
    • The selection box is more clearly visible, and can be changed if desired by editing the SelectionBox texture in the SpriteTile default editor resources folder.

    TileEditor Fixes:
    • The tile defaults for order, rotation, etc. are shown properly for the first tile in the first set when the TileEditor window is first opened.
    • Deleting tiles in the level view is possible if a new set with no tiles in it is displayed.

    -----------

    Note that SetLayerColor doesn't entirely play nice with SetColor/GetColor, and is no longer really needed since SetColorBlock exists now. So it should be considered deprecated and I'll probably remove it in the next version.

    --Eric
     
    theRiley likes this.
  9. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I just downloaded your plugin from the Unity Asset Store. I seem to be having a few issues with SpriteTile. When I first open the editor window I get these 2 errors:
    Error 1:
    Error 2:
    The other issue is when I click the grid checkbox on the Level window, no grid shows up. Also, the collider tint color does not seem to work. I'm not sure if these are caused by the other errors.
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I created a new project, imported SpriteTile from the asset store, and there are no errors, so I don't really know what to suggest, unless there are other errors causing the ones you posted. I expect the "no grid" thing is because you haven't imported any tiles yet and the tile size for the level is 0.

    --Eric
     
  11. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    It seems the issue is somewhat involved with what you mentioned. After I imported a tile and then set the level to bigger than 0, I had to close the SpriteTile window and open it and it seemed to work fine. I guess it's not important, but maybe in the next update it'd be nice to put in a check to prevent that error from popping up.
     
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well, that's the thing; the errors you posted doesn't happen here and there are already checks to prevent null reference errors, so I'm not sure what I can do without knowing more. Try what I said about creating a new project, importing SpriteTile, and see what happens. If there are any errors, post all of them; typically the first error causes cascades and the later ones aren't really meaningful.

    --Eric
     
  13. joe90

    joe90

    Joined:
    May 16, 2014
    Posts:
    12
    Just got this, and looks good.

    Just a question.. what I want to do is when a tile first appears add some child sprite to it, and then they scroll off stole the locations (relative to the parent tile), so when they appear again basically the child sprites appear in the same location.

    I guess I need something like onBecameVisiable()? is that currently possible? Each sprite will need a collider (polygon[can I lower the auto number of vertexs??]) + 2d physics body and possible a trigger.. ? is that also possible or will I need to do my own engine?

    Thanks
     
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not sure I understand...what are you actually trying to achieve?

    --Eric
     
  15. joe90

    joe90

    Joined:
    May 16, 2014
    Posts:
    12
    Soz, will attempt to be more clear (was rush typing at work).

    Basically, I want to be able to add child sprite/animation to a tile. For example, if I have a 256x256 garden tile, when that tile first appears on the screen, 3 animated flowers get added to the garden at a random location. Now, when that scrolls off the screen the flowers are removed back into the 'flower pool', but the locations of the flowers on that tile are stored.

    So when that tile appears on the screen again, I can get the flowers from the pool and place then at the saved locations on the garden tile?

    Thanks
     
  16. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It sounds like the GrabSprite function in SpriteTile 2.3 would work well for that, since you can add OnBecameVisible functions and so on. It should be available on the asset store within a few days.

    --Eric
     
  17. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    A lot of changes is coming, it is good to hear it.

    Eric, I have a weird problem. I put all maps in differents scenes and load all scenes as stages to run the map. My maps have a tile when it is loaded it is replaced for player prefab, no problem on that, but differents maps result in different player position, somehow my previous player map position is being stored, so when I load scene 02 after load scene 01, the tile player position from 01 remaining somehow. Have you see something like that?

    Sorry about my english.
     
    Last edited: Aug 4, 2014
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That depends on what your code is doing; I can't really advise without knowing more.

    --Eric
     
  19. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    Sorry Eric, I have fixed the previous error that was about Instantiate function. So I'm facing another error:

    I'm loading every map from each scene, when I reach map 5 (the fifth game scene) it crashes and raise up this error:

    The procedure to load each map is the same from all levels, I really don't know why it is coming up. This map is a little wider than others I dunno what is causing this error.

    Could you please enlight me there?
     
  20. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Seems like one of the changes in 2.3 might fix that; I hope it will be approved on the asset store soon.

    --Eric
     
  21. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    I'm excited about that even more about the news that you'll bring soon.

    However, just a clue what is crashing the loading map? I noticed when I load the map without a sequence (no scenes loading in a row) just the straight scene it doens't crash, weird so far.
     
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    A Transform has been destroyed but something is still trying to access it. I'm guessing that's the camera, so the change in 2.3 about being able to call SetCamera again probably will fix it. I hope. I did a test here (using 2.3) where it loads a smaller map in one scene and then loads a bigger map in another scene, and there aren't any errors.

    --Eric
     
  23. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    Will SetCamera() stop to raise an error when you try to set it again?
     
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes.

    --Eric
     
  25. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    I've checked e-mail now and made 7 days since when you have released the new version.

    I'll check it right now and give you a feedback.
     
  26. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Did you buy it from my site, or the asset store? It was available on my site on July 29 and update emails were sent out that day, for everyone who has update notifications turned on. If you bought from the asset store, I have no control over that, and we're still waiting for approval.

    --Eric
     
  27. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    From your site, not from Unity Asset Store.

    If I remember well it was not yet available on Unity Store when you have released, I think I'm one of the first to buy it.
     
  28. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    Eric, where tileset is stored? I changed 2.2 to 2.3 and I lost all previous configured tileset, maybe I missed something else to properly upgrade it, dunno.
     
  29. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The data is in SpriteTile/Resources/TileManager. However updating from 2.2 to 2.3 doesn't remove that data; I tested again just now to be sure. If the TileManager file gets messed up somehow, you can restore it from a valid backup, or if it's just the script reference that's gone missing, you can restore that and the data should be intact (see page 3 in the docs, at the bottom).

    --Eric
     
  30. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    I have made some changes for this new version:

    - No more I have to check if camera is set up on Tile and before that I was getting the "transform" error, for now I'm facing another issue:

    If I turn back and check if camera is already set up this error no longer happens, however the previous one about "transform" still remainings. Regardless where it end up the problem happens.

    Just to be more clear when this occurs:

    - If I straight load the scene when this issue happens, nothing wrong happens so the map is loaded properly;

    - But if I move between the previous scene and the next scene (scene with the map that error raises up) so it crashes.

    Thanks once again
     
  31. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I'm not able to reproduce that here, so I'd need you to send me a project that shows this behavior.

    --Eric
     
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Version 2.3 is available on the asset store now, by the way.

    --Eric
     
  33. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    I just bought this earlier today hoping it would help me get going on some good 2d platform game development.

    For someone coming from an Assembler, C, C++ and then C# background doing game dev with DirectX, Allegro, XNA and so forth... Unity3D is weird and takes some getting used to! I like it and am getting to grips with it.

    So... after struggling around a bit I got my tiles loaded, map built and then actually was able to see it when I ran my game. I never saw the level map in the normal scene view which seemed strange to me because we always see our scene in Unity but I guess that is how it works with SpriteTile maps.

    Anyway, there are two things I ran into which I wondered if maybe someone else may have already dealt with?

    First, is when my map is rendered (i.e. playing the "game") I see what looks like some shearing vertically between the tile columns.

    Second, if I press a key (does not matter what the key is) while viewing the "game" an error message appears in the log: !dest.m_MultiFrameGuiState.m_NamedKeyControlList
    That is all the error shows. No line #, component or any other information.

    Since I have nothing like this in my own code it must be something in either SpriteTile or Unity3D itself.

    I have attached a screenshot that illustrates both issues. You will see the 12 lines running vertically. They are not supposed to be there. ;)

    Appreciate any help with this. Thanks!
     

    Attached Files:

  34. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Using pixel snap for the tile shader should fix that; alternately you can use the SetTileScale function.

    The error message is because of a Unity GUI bug which happens after you run the procedural level demo, if you're using Unity 4.0-4.3; it's annoying but harmless. It's somewhat fixed in Unity 4.5, though saving the scene will still trigger it. If you reload Unity it will go away, as long as you don't run that demo again.

    You can see the map in the scene view by using the preview function in the TileEditor.

    --Eric
     
  35. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Thanks for the super fast response!

    I actually just finished messing around some more. I know I have seen problems with the Unity sprite editor not correctly defining the boundaries so I tried playing around with those values on the tile sprites.
    That did not fix it.

    But, I then remembered seeing some artifacts occur because of the Filter Mode not being set to Point.
    I checked and Filter Mode for my tile sprites was set to Bilinear. I changed it to Point. Applied the changes. Ran the "game" again and the artifacts disappeared! So, this was not SpriteTile's doing either.

    One thing I still do not quite understand with Unity is how in hell does a person know where to set the camera? It just seems strange to me. Like I figured if I had the camera at x:0 y:0 the display would be centered on the middle of the map but it wasn't. To make the display actually resemble what it should be (based on using 32x32 pixel tiles and a 640x480 screen resolution in DirectX, XNA, etc) I had to set my camera to X=4.96, Y=3.34 and Z=-6.65 ... it works and all and this is not really your SpriteTile system doing it either (I don't think?) It just seems like those are some crazy values I arrived at through continual trial-and-error to get the damn display centered to look the way it should.

    Just read the reply you sent from my earlier email. Thanks! That helps a lot for the camera positioning.
     
  36. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    (0, 0) is always the lower-left of the map. If you have the tile size set to 1.0, for example, and the map was 100 tiles wide, then the middle would be 50.0. The TileEditor shows the world position of each tile at the bottom of the level view.

    --Eric
     
  37. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Fantastic! Your SpriteTile add-in definitely makes building tile-mapped games so much simpler. Alright, now I need to get my head stuck into the project defining all of the flags for each tile and so forth.

    Speaking of which, one possible enhancement would be to support the inclusion of tile attributes (flags) from the Tiles section.

    For instance, what I will be doing next is creating a Flags enum specifying all of the different attributes that can apply to a tile:

    Code (CSharp):
    1.     [Flags]
    2.     public enum TileFlag
    3.     {
    4.         None          = 0000,
    5.         Wall          = 0001,
    6.         Breakable     = 0002,
    7.         Bouncy        = 0004,
    8.         Crumbles      = 0008,
    9.         Falls         = 0016,
    10.         Water         = 0032,
    11.         Spikes        = 0064,
    12.         Treasure      = 0128,
    13.         Key           = 0256,
    14.         Interactive   = 0512,
    15.         Sign          = 1024,
    16.         Ladder        = 2048
    17.     }
    18.  
    Then I will need to define an array of TileFlag, one item for each of the tiles being used and map the attributes to each tile. Like:

    Code (CSharp):
    1.             aTileFlags = new TileFlag[16];
    2.  
    3.             aTileFlags[0] = TileFlag.None;
    4.             aTileFlags[1] = TileFlag.Wall;
    5.             aTileFlags[2] = TileFlag.Wall;
    6.             aTileFlags[3] = TileFlag.Wall;
    7.             aTileFlags[4] = TileFlag.Wall;
    8.             aTileFlags[5] = TileFlag.Ladder;
    9.             aTileFlags[6] = TileFlag.Treasure;
    10.  
    where the index [] maps to the Tile# in the Tiles list.

    Pretty standard stuff really so a person does not end up with a mess of if tileId=thisOne or tileId=thatone or tileid...

    Anyway, just something to think about for the future. It might be handy to allow specifying the tile flags and letting us pull that information back out with a GetFlags() function or a HasFlag(FlagID) function.

    Alright I will shut up now. Time to get at it.
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use tile triggers for any arbitrary purpose such as flags, though being one byte, 255 is the max value.

    --Eric
     
  39. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Thanks!

    After spending a few days playing around with your excellent extension I decided to write a review on the Asset store. Just posted it. You really did an excellent job on this thing.

    I think the part I like the best are the multiple layers. This is something I covered in my review as well.

    Many years ago on the Amiga I developed a stage editor and, at the time, it was very powerful compared to the others I had seen. I could define non-interactive background stuff (dirt, etc), active scenery (obstacles and stuff), items to be collected, etc. Each of these were placed in their own layer. So, anyway, I am glad to see the multiple layers support.

    I think it is important people realize these layers really provide a framework to do a ton of things:
    * Parallax scrolling
    * Separating non-interactive scenery from interactive scenery
    * Providing a way to define sprite positions (player, enemies, etc)
    * One could even use layers to define the type of tiles (things that can be climbed, things that can be blown up, etc.)

    Anyway, just wanted to give you some feedback now that I have had an opportunity to play around with SpriteTile.
     
  40. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yay Amiga! I appreciate the review; I hope it gets voted up since I think it's the most helpful one so far.

    --Eric
     
    GarBenjamin likes this.
  41. mikeblazek

    mikeblazek

    Joined:
    Feb 26, 2014
    Posts:
    9
    Just purchased, and after looking at basically everything out there and trying a few tools SpriteTile is by far the best I could find. So thank you for making a great tool.

    That being said, I am having a few issues, when I load the map it shows up and I can see it. I move the camera around and it reveals more of the map. The problem is that it hides part of the map that the camera is showing still. Hopefully you can see what I mean from the picture I attached:

    Screen Shot 2014-08-14 at 7.59.30 AM.png

    Did I miss something or do I have something set up incorrectly? The camera I am using is the default 2d Camera.

    **Edit**

    Addition issue is that my tile set is imported with point and I still see lines between my tiles. Look at the block tiles under the sidewalk and you will see spacing there. Any idea what the problem is there?

    Thanks in advance for you help.
     
    Last edited: Aug 14, 2014
  42. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Thanks! Are you using oversize tiles (that exceed the bounds of the grid)? If so then you can fix the camera problem by using the "add border" setting to add 1 or more tiles; see page 14 in the docs. As for the lines between tiles, try using the pixel snap setting in the material, or using SetTileScale to enlarge the tiles very slightly.

    --Eric
     
  43. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Just wanted to share something that might be helpful to someone out there....

    I continually battled with the gaps between tiles. I tried various things and the gaps would go away and then would return again. I have no idea why.

    I tried pixel snap and changing the size of the tiles in relation to the map but neither resolved the issue.

    Finally, I noticed I had the game set to use 4:3 aspect ratio (because I am targeting a 1024x768 display so that made sense to me). Anyway, I changed it to Free Aspect and the gaps / vertical lines went away completely.

    In fact, the whole display seemed to look a bit better overall. A little sharper maybe.

    So, if you are wrestling with this gap issue and the pixel snap does not work try changing to Free Aspect on the game window.
     
  44. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Cool asset,

    Does parallax work with Ortho cam?
     
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, although you'd have to scroll the layers yourself.

    --Eric
     
  46. jimdubbs

    jimdubbs

    Joined:
    Dec 3, 2012
    Posts:
    12
    Hey Eric, thanks for the great tool!

    I've been playing around with it and love it so far. I'm having an issue though that may just be my own stupidity. I'll give you a brief explanation of what I'm trying to do...perhaps its not the best approach at all..

    Basically I have a background tile thats 500x500. So I created a level, with layer 0 being 10x1 with tilesize of 5x5.

    I then have 5 tiles that can overlay the background tile which are 500x100 each. So I created a 2nd layer (set it up as a sort layer first) with a size of 10x5, and a tilesize of 5x1. Theoretically those 2 layers should be the exact same size. However when I run the game, the very bottom tile of layer 1 (the 10x5 layer) is only about half way down layer 0. Do you understand what I mean? I'm using Orthographic camera so I would assume what i'm doing is correct.

    Any light you could shed on this for me would be great.
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Are the pixel-to-unit settings the same for both tiles? Also, are the pivot points set correctly? Namely they would have to be set to "bottom" for both tiles if you wanted the layers to line up automatically, though you can of course offset the layers manually instead.

    --Eric
     
  48. jimdubbs

    jimdubbs

    Joined:
    Dec 3, 2012
    Posts:
    12
    Pixel to Units are both set to 100. I dont quite understand what you mean by pivot points. Could you explain?
     
  49. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The pivot points of the sprites, which is under the pixel-to-unit setting. By default it's center...if you had the big sprite with a centered pivot and the smaller sprites also with a centered pivot, then the first small sprite would be centered on top of the large sprite, with the other 4 small sprites stacked on top of that. If the pivot is bottom for both sprites, then they would line up since they'd both be starting from the same bottom edge.

    --Eric
     
  50. jimdubbs

    jimdubbs

    Joined:
    Dec 3, 2012
    Posts:
    12
    Hmm..I've tried changing the pivot points but it doesnt seem to be working. I guess I just dont fully understand how its supposed to work.