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 - LaserDinosaur

Pages: 1 [2] 3
16
Support / Re: Tile XY Position not precise
« on: September 02, 2015, 06:23:07 pm »
It's usually a good idea to set your PPM to 100, that plays nicer with Unity's physics systems. In Unity the default is 1 unit = 1 meter, which then works out to be 100 pixels per meter. That gives the physics system a bit more of a normalized world scale. At 1 pixel per meter, a sprite that is 32 pixels high is now 32 meters tall, which will create some large scales that the default settings don't handle too well (eg. Min Penetration, Velocity Threshold).

If you do use a PPM of 100, any time you want to move a unity a certain number of pixels, just divide by 100 (so 32 pixels becomes 0.32f). Also it's not a good idea to change this value half-way through development, it will throw off your layouts quite a bit.

Extra threads on the topic:
http://2dtoolkit.com/forum/index.php/topic,3498.msg20148.html#msg20148
https://www.reddit.com/r/Unity2D/comments/2aqg9d/what_pixel_per_meter_should_i_develop_the_game_at/

17
Support / Re: Sprite Collection Doesn't Exist in Drop Down
« on: August 30, 2015, 08:23:07 pm »
Perhaps try deleting your 'Temp' folder in your project and let Unity regenerate it when you restart? Did you check this folder in with your repository?
What happens if you copy+paste from one of the computers that is working, instead of downloading through the repository?

18
Support / Re: Pixel perfect sprites and camera zoom values
« on: January 21, 2015, 02:42:41 am »
Cool, that's what I was thinking of too, glad to know I was on the right track.
 
It's funny how silly little concepts like this are so obvious in retrospect, but when your just getting started in game development it's such a huge "AHA!" moment ;D

19
Support / Pixel perfect sprites and camera zoom values
« on: January 20, 2015, 02:13:15 am »
Hi there

I seem to have run into the same problem as this poster back in August.

I have my native resolution matching my preview resolution, I have the pixel-perfect override turned on. After playing about with a dither test on my own I eventually found that it seems to work fine as long as the camera zoom is a whole number. Setting it to 1, 2, 3 etc. means no pixels pulsating and swimming around the screen, but if I set it to 1.2 it goes all screwy. It seems that a half zoom (eg. 1.5) is the worst.

Looking at the preview video of the Pixel Perfect asset that the other poster linked too, it seems that it's zooming in using whole numbers as well - so possibly it has nothing to do with one system being better than the other and entirely to do with using whole numbers when zooming in.

Which leads me (finally) to my point - is there something inherently wrong in using fractional zoom values on a camera? Is there something going on in the background with rounding errors that means cameras (at least for pixel perfect) should always be whole numbers?

Thanks!

20
Support / Re: Prefab sprite overriding tilemap sprite
« on: September 14, 2014, 09:00:29 pm »
Thanks for the reply.

So I added in a few extra lines of code to the class you mentioned. I'm now getting the tile flags and flipping the prefab sprite if needed. That seems to work pretty well.

However I'm wondering if you could expand on your point "It doesn't do that by default as it really really screws up performance due to breaking batching".

If I'm only doing this on maybe 20-30 prefabs in the world, is it still a bad idea to do this? What is it about flipping the prefab that causes the batching to break? I did some quick tests and didn't notice the draw calls increasing.

Cheers!

21
Support / Prefab sprite overriding tilemap sprite
« on: September 07, 2014, 06:07:09 pm »
I'm using a tilemap with some prefabs as per http://www.unikronsoftware.com/2dtoolkit/docs/latest/tilemap/tutorial.html.

I have a wall that has special properties which I turned it into a prefab so I can attach a script and set the collider as a trigger. The problem is because the sprite is now part of the prefab it overwrites the sprite used in the tilemap. That means if I placed the tile (through the tilemap editor) in a flipped-horizontal, flipped-vertical or rotated position, it's lost when the game starts.

Is there a way to use a prefab in a tilemap but let the tilemap sprite take priority?

Cheers!

22
Support / Re: How do you move the entire tilemap?
« on: August 29, 2014, 04:37:29 pm »
Dang, well, no worries I'll have a look at the script and see what I can find.

Maybe as a future feature request we could move the tilemap boundaries?  ;D

23
Support / How do you move the entire tilemap?
« on: August 29, 2014, 03:16:57 pm »
I'm building out my level using a tilemap but realized that I needed to change the boundary size (I'm not sure what the exact term is, but the boundary size you can place tiles in which appears as a white square in the editor). I went into the tilemap properties and changed "Dimensions" to the recommended maximum of 1024, just so I don't have to worry about it again. However the layout size doesn't resize from the middle, it resizes from the top and the right. Now my level is stuck in the bottom left corner.

Is there a way to move the entire tilemap inside the layout boundaries? I tried moving the tilemap layers in the hierarchy but once I started the game it popped back to its old location. I also tried using the 'cut' command, but since I have several layers it quickly becomes messy trying to cut+paste them back into the correct locations (unless there is a way to cut all layers at once).

Is there any way to move the whole tilemap inside the layout boundaries?

24
Support / Re: Instantiate tk2dSprite loses tag
« on: August 19, 2014, 06:59:25 pm »
1) Does your laser prefab have any child nodes? If so, is your collider attached to the parent or the child node?
2) If you do a check for 'laser.transform.name', what is it called?

25
So if I understand correctly, explicit is saying render 1:1 with the source file at a fixed resolution, where as pixels-per-meter says render it out using the given scale of 100/1? Would rendering with a pixel-per-meter of 1 have the same effect as setting the explicit size?

Am I at all correct ;D? Is there any situations where one would be better over the other?

Cheers!

26
Hi

I was building out a button using the sliced sprite component. I noticed though that the edges of the button are quite blurry.

I compared my sprite collection to the one in the tk2d UI demos and noticed that it's sprite collection is using Explicit size instead of pixels per meter. If I flip the UI demo over to pixels per meter (matching the pixels per meter of my camera) it has the same blurring effect.

Explicit:
https://dl.dropboxusercontent.com/u/20830426/tk2dExplicit.png

Pixels Per Meter:
https://dl.dropboxusercontent.com/u/20830426/tk2dPixelPer.png


For now I'm just using two separate sprite collections so it's not a huge deal, but I'm curious what the difference between the two are.

Thanks!

27
Support / Updating tk2dUILayout collider at runtime
« on: August 16, 2014, 01:10:42 am »
Hi

I have a popup window that has various amounts of content. The window has a tk2dUILayout component which contains a button called "Fit Layout To Geometry".

Clicking this works fine when in edit mode, but I also want to fire that same event at runtime after I've added content to my window.

Am I missing a very obvious method somewhere or is resizing the colliders at runtime more tricky than that?

Cheers!

28
Support / Re: Tips on passing content to hover window?
« on: August 12, 2014, 11:41:58 pm »
Thanks for the feedback, I think that's the way I'll go then.

Coming from a web background I think I'm too used to just injecting HTML into modal windows. I keep trying to figure out how in Unity to serialize all the content and push it into the window. I guess the best way of handling it is to just make several popup window prefabs, one for each usage and content type. That works fine with the tk2dUIItem parameter then.

Cheers!

29
Support / Re: Tiled Map Editor Help
« on: August 12, 2014, 05:07:28 am »
I want the user to be able to click on a tile and get its coordinates on a grid.

You could try using tk2dTileMap.GetTile (int x, int y, int layer). Once you get the tileID you can use GetTileInfoForTileID.
http://www.unikronsoftware.com/2dtoolkit/docs/latest/html/classtk2d_tile_map.html#a36ad0e3e4d3db0276d16c52f4438b5f6

Although you will probably have to convert your mouse to world coordinates first:
tk2dCamera.Instance.camera.ScreenToWorldPoint(Input.mousePosition);


30
Support / Tips on passing content to hover window?
« on: August 12, 2014, 04:58:24 am »
Hi all

I am using the OnHoverOverUIItem to initiate a new popup/tooltip window for my game (it's for hovering over items and skills and seeing the information). The popup window is a prefab with a blank content area.

I'm trying to figure out how I can pass content to the popup window. For now I have the popup window hardcoded to look at certain components in the 'tk2dUIItem' parameter that gets passed through. But since I want the popup window to be versatile I don't always know what components to look back to 'tk2dUIItem' for.

Does anyone have any advice on how to pass content to a window when using 'OnHoverOverUIItem'?

Cheers



Pages: 1 [2] 3