Hello Guest

Author Topic: Tile map problems  (Read 18612 times)

Aorata

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Tile map problems
« on: July 11, 2012, 11:44:34 pm »
I'm not sure if it's not supported or if I'm being stupid.

I want to use a full size image of a platform to break into separate tiles and build from that.
That way, if I want to extend the platform, I can duplicate many tiles of the middle section.

Like this:
Full platform breakdown into> Corner -center - Corner   so I can duplicante "centers" and make> Corner - center - center- center- Corner

However, when I have a spritecollection with the full size image, I can't do the breakdown...

So I though, I'll just make a sprite collection of the already separated 64x64 images and then build from that... My platform is built out of 22 separate tiles. If I could arrange them somehow, all would be perfect, but when I import them to the tile map editor, the order gets scrambled into something that doesn't make sense to me...

And making each platform one by one without being able to select 6x tiles at the same time, is just no good.

I hope I made myself clear, english is not my first language. I'll be happy to repost if something is not understood.

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #1 on: July 11, 2012, 11:54:16 pm »
Have you tried importing the texture into the sprite collection as a SpriteSheet (New > Sprite Sheet). It was built to solve this very problem.
Also, once you've created your tilemap, in settings > palette properties, adjust tiles per row so it will match your original spritesheet.

Hope that helps. If I didn't get what you meant, please post some pics to explain.

Aorata

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Tile map problems
« Reply #2 on: July 12, 2012, 05:10:06 pm »
No I haven't, so I am being stupid.

And I'm going to continue with my stupidity.

You said I should import the texture into the sprite collection as a SpriteSheet... I don't know how to do that. What I did was create the SpriteSheet and just drag the textures into it.

I know, from inside the SpriteSheet editor I can create a SpriteSheet that will be called New Sprite Sheet, but I don't know how to import or edit the tiles there.

If there is a manual on how to do it, or if you can explain it I would be veeery grateful.

Thanks a lot!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #3 on: July 12, 2012, 05:20:09 pm »

Aorata

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Tile map problems
« Reply #4 on: July 12, 2012, 05:28:38 pm »
I read that, if I understand correctly, I can import a spriteSheet created in another program like zwoptex? But I can't do the editing within 2dtoolkit.
Am I mistaken?

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #5 on: July 12, 2012, 05:32:02 pm »
Not really. You can import evenly divided spritesheets, like the one in the doc page.
You can't import complex spritesheets in yet.

Aorata

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Tile map problems
« Reply #6 on: July 12, 2012, 06:37:56 pm »
So I was being stupid.
All solved.
Thanks a lot!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #7 on: July 12, 2012, 06:40:40 pm »
Glad its sorted!

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: Tile map problems
« Reply #8 on: July 16, 2012, 03:14:01 am »
I'm using this method for my tilemaps, and I'm wondering why the transparent tiles in the palette have a white fill in the transparent area? Of course they are using transparent shaders, and the tiles look completely fine when I paint them, but it is a little distracting having that mess in the palette. Is there something I'm missing? Thanks.
« Last Edit: July 16, 2012, 03:26:40 am by fsadeq »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #9 on: July 16, 2012, 08:10:15 am »
They should look the same, they use the same shaders. What version are you running? I fixed a bug in 1.76b2 where incorrect vcolors meant you got some weird behaviour sometimes. Also could you post a pic of this so I there isn't any confusion as to what were talking about?

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: Tile map problems
« Reply #10 on: July 16, 2012, 11:54:06 am »
I'm using the latest you posted. I don't have access to the project now, but if you look at the picture here http://unikronsoftware.com/2dtoolkit/doc/tilemap/Tutorial.html at step number 6, the space around the triangle or the flag for example would be filled white instead of transparent.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #11 on: July 16, 2012, 09:51:13 pm »
Thats really strange (and unexpected). The code actually uses the exact geometry drawn in game in the palette, and uses the same shaders. Something must be going horribly wrong. Do you have premultiplied alpha enabled on your sprite collection, or a custom shader?

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: Tile map problems
« Reply #12 on: July 16, 2012, 10:32:37 pm »
I don't have premultiplied alpha on and am using both the included SolidVertex and BlendedVertex shaders. Strange thing is that I am not noticing this problem with tilemaps using sprite collections without sprite sheets, only the ones with them. When I turn on premultiplied alpha, the transparent ares fill black instead of white. Also, to clarify, I am not noticing this in either the the sprite collection editor or the final render data, only in the tilemap palette.

Maybe there is something completely obvious that I am overlooking? I will try re-creating from scratch.

Also, probably completely unrelated, but I've gotten this error two or three times. Not sure what I did to get it:

Code: [Select]
ArgumentException: Getting control 4's position in a group with only 4 controls when doing mouseUp
Aborting
UnityEngine.GUILayoutGroup.GetNext ()
UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayoutUtility.GetRect (Single width, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.Space (Single pixels)
tk2dTileMapEditor.DrawTileDataSetupPanel () (at Assets/TK2DROOT/tk2d/Editor/Tilemap/tk2dTileMapEditor.cs:240)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2d/Editor/Tilemap/tk2dTileMapEditor.cs:1021)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
UnityEditor.InspectorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
« Last Edit: July 16, 2012, 11:57:15 pm by fsadeq »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tile map problems
« Reply #13 on: July 17, 2012, 10:26:52 am »
Which tilemap editor view were you on when you got that?

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: Tile map problems
« Reply #14 on: July 17, 2012, 11:59:52 am »
Honestly don't remember, I didn't see it immediately. But I think paint mode.