Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Logon

Pages: [1] 2
1
Releases / Re: 2D Toolkit UI 1.0 beta 3
« on: April 27, 2013, 09:15:14 pm »
It looks like the UI and iTween does not work together because it doesn't move the button at all but if i assign the localpos manually it moves, but not through itween.

2
Support / Re: Iso Tilemap behaving strange over partition borders
« on: April 23, 2013, 07:50:02 pm »
Okay, Disregard that i didn't have the camera reset and it was set to iso so the fix was just to rotate it and align to z axis and do ortho again.

Sorry for that.

3
Support / Iso Tilemap behaving strange over partition borders
« on: April 23, 2013, 07:08:36 pm »
Hello!
I seem to have a strange behavior over partition borders in the scene editor where it looks like it's one level above and it even seem to draw one extra for some reason.




Any ideas what is causing it? i really like a nice scene editor but i guess i'll live if i have to

4
Releases / Re: 2D Toolkit UI 1.0 beta 3
« on: April 22, 2013, 10:06:26 am »
Really nice work!
Used this for my main menu plus inventory screen and it works like a charm.

will this be included in the package or is it a seperate purchase ?

I would also like to know this.

5
Support / Re: Tilemap update
« on: April 21, 2013, 12:41:30 am »
I acually implemented poolmanager into your function so it's muuuuch faster now with the fix i did too but thanks for looking into the function for the next release!

6
Support / Re: Tilemap update
« on: April 21, 2013, 12:14:04 am »
There is another thing you need to do

                        if (chunk.Dirty || forceBuild)
                        {
                            SpawnPrefabsForChunk(tileMap, chunk, baseX, baseY);
                        }

just add
  public static void SpawnPrefabs(tk2dTileMap tileMap, forceBuild = false)


and pass the forcebuild variable from the build function

7
Support / Re: Tilemap update
« on: April 20, 2013, 10:28:05 pm »
Btw i guess the tilemap update for prefabs this is the foe

/// Spawns all prefabs for a given tilemap
      /// Expects populated chunks to have valid GameObjects
      public static void SpawnPrefabs(tk2dTileMap tileMap)
      {
         int numLayers = tileMap.Layers.Length;
         for (int layerId = 0; layerId < numLayers; ++layerId)
         {
            var layer = tileMap.Layers[layerId];
            if (layer.IsEmpty || tileMap.data.Layers[layerId].skipMeshGeneration)
               continue;
            
            for (int cellY = 0; cellY < layer.numRows; ++cellY)
            {
               int baseY = cellY * layer.divY;
               for (int cellX = 0; cellX < layer.numColumns; ++cellX)
               {
                  int baseX = cellX * layer.divX;
                  SpriteChunk chunk = layer.GetChunk(cellX, cellY);
                  if (chunk.IsEmpty)
                     continue;
                        if (chunk.Dirty)
                        {
                            SpawnPrefabsForChunk(tileMap, chunk, baseX, baseY);
                        }
               }
            }
         }
      }

you don't check if the chunk is dirty in your code.

8
Support / Re: Tilemap update
« on: March 27, 2013, 05:31:49 pm »
tk2dSpriteCollectionData.CreateFromTexture you have to recreate the entire sheet each time you want to add something is there a way to just add one?


Thanks

9
Support / Re: Tilemap update
« on: March 27, 2013, 10:56:10 am »
The good thing about runtime is that i don't manually have to sit and do around 21 sprites and if the sprites are never used they don't take up any space either.
I don't really get what you are saying i should do but i'll dig some when i get home from work and see if i can figure it out.

What i in essence want to do is draw 4 (out of 14) sprites on 1 quad and possibly all the variations of the 14 sprites in these 4 slots. if you can give me a tip on how to do that i can probably figure out the rest by myself.

10
Support / Re: Tilemap update
« on: March 27, 2013, 10:26:55 am »
No i don't neccesarilly need to use instances to do what i am trying to accomplish

can i do something like this
SS1 Transitions Spritesheet
SS2 Tilemap Spritesheet

texture2d t = new texture(32,32)

t.setpixelsinrectangle(ss1.rectangle(0,0,16,16)(This gets a tex2d from 0,0 size 16,16))
t.setpixelsinrectangle(ss1.rectangle(16,0,16,16))
t.setpixelsinrectangle(ss1.rectangle(0,16,16,16))
t.setpixelsinrectangle(ss1.rectangle(16,16,16,16)

if(ss2.exists(name: "transID-transID-transID-transID")) else
 SS2.add(texture: t, name: "transID-transID-transID-transID");
 tile.setid(GetIdFromname("transID-transID-transID-transID"));
endif;

this way i get sourcerectangles from the first spritesheet(Would be awesome if i could get sourcerectangle from the spritecollection instead of doing the "math" myself)
and mux them together to form a 32x32 tile and i add that to the tilemap spritesheet. The problem i can see doing this is that a 2048x2048 spritesheet only holds 128 tiles(or can the spritesheet be as big as i want? i guess not because that requires dx11 right?

11
Support / Re: Tilemap update
« on: March 27, 2013, 06:43:59 am »
To do transition tiles between tiles
so each tile 32x32 contains 4 16x16 tiles which can make up any combination of transition to a nearby tile so i use a GO with a StaticSpritebatcher which in turn means that the tilemap could change at any time.

While you are racking your head with this is there anyway to mux together 4 16x16 sprites into one big 32x32 sprite and put it in a spritesheet at runtime?
Because i don't need the gameobject logic i just want a 32x32 sprite basiclly only this was the solution i could come up with.

Thanks
Logon
ps Registered my copy last night awesome pack!

12
Support / Re: Tilemap update
« on: March 26, 2013, 06:43:20 am »
But does this not stop the prefab from spawning the first time?
So say it is a (0)Noprefab and i change it to 4(prefab) and run the modified build will it spawn the new prefab at all?

Any ETA on when you will fix this?
A feature tip, you could pool deleted prefabs from the chunkmap

Edit:
You already have the function SpawnPrefabsForChunk(tk2dTileMap tileMap, SpriteChunk chunk, int baseX, int baseY) ;

tileMap.Layers[layerId]; 
int baseY = cellY * layer.divY;(What do you do here?)
int baseX = cellX * layer.divX;(And here?)
var chunk = layer.GetChunk(cellX, cellY);
SpawnPrefabsForChunk(tileMap, chunk, baseX, baseY);


 Object prefab = tilePrefabs[tile];                                         
 if (prefab != null)    Shouldn't this be prefab == null?                           
{
                                                  prefabCounts[tile]++;
                                                   #if UNITY_EDITOR && !(UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
                                                  GameObject go = UnityEditor.PrefabUtility.InstantiatePrefab(prefab) as GameObject;
  #else
                                                  GameObject go = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.identity) as GameObject; 
#endif
                                                ETC...
}

13
Support / Re: Tilemap update
« on: March 25, 2013, 09:22:35 pm »
It's the chuck itself it seems like it is reinstantiateing all the prefabs each time i change the tile to prefab(4) and then in turn runs Awake

14
Support / Tilemap update
« on: March 25, 2013, 08:35:17 pm »
The Build() takes around 2000ms (around 46k objects)
the Tileset has 5 tiles, one of them is a prefab
/*
Grass
->Transition StaticSpriteBatch containing
-->UpLeft
-->UpRight
-->DownLeft
-->DownRight
*/

and when i do
            WorldClass.TileMap.Layers[Layer].SetTile(Mathf.RoundToInt(Index.x),Mathf.RoundToInt(Index.y),4);
            WorldClass.TileMap.Build();
it rebuilds then entire tilemap and resets all the gameobjects
The chunks are 16x16
Is there a way not to make it rebuild everything?
Tried BeginEditMode/EndEditmode, Build(editmode), Build(default), Build(Forcebuild) none of them seem to work faster then 2000ms.

//Thanks
Logon

15
Support / Re: Tilemap Sprite Size
« on: February 19, 2013, 05:35:46 pm »
That fixed it, i forgot to use tk2dCamera.

Pages: [1] 2