Oct 01 2014
I was wrestling a bit with how to get my tiles 1:1-scale. Turns out this is the way to go:
-
Set camera to orthographic (2d), and set the size to screen height/2. Since I optimize for PS Vita screen (960×544) that’s 272.
-
Now the tiles are super tiny. That’s because I created the vertexes with 1 unit as spacing. My tiles are 64×64 so I can either re-write all my vertexes (multiply them with 64). OR we can keep the 1-unit vertexes and divide the camera size (272/64 = 4.25)
Bingo!
Will probably cause some problem when I have to move my sprites by 1/64 per pixel… That’s future Tommy’s problem though =)
Oh, and if you have a dynamic size of your screen you can use Screen.height;
Edit (2016-12-14):
here is a good blog post from Unity about pixel perfect 2d in Unity:
https://blogs.unity3d.com/2015/06/19/pixel-perfect-2d/
Sep 28 2014
I’m done witht the Tutorial now that I’ve spent the last week working on.
<< Click to play >> (req. Unity Web Player)
It was a very good tutorial, and I think it was good to make a complete project from start to end, including different screens, win/lose-conditions, sounds and publish settings. Highly recommend that tutorial for anyone who’s new to Unity!
I also found a cheat sheet to the keyboard shortcuts in Unity. Good one to note is Ctrl + P to test the current scene.
http://blogs.unity3d.com/2011/08/24/unity-hotkeys-keyboard-shortcuts-in-unity/
Sep 25 2014
Tired tonight. Only got one new part of the tutorial done, but it’s one long part left. Will have to be tomorrow:
http://www.raywenderlich.com/71029/unity-4-3-2d-tutorial-scrolling-scenes-and-sounds
The tutorial so far is actually really good! It goes a bit out of line in name of teaching, but I guess that’s ok.
There is no way I’ll be able to enter in that miniLD, but I guess that’s ok too. Better to go through a few of these tutorials instead and get to know all the quirks of Unity instead of trying to learn by bashing my head against it.
As soon as the tutorial is complete I’ll post a link to the final game.
Oh, and note to self:
I really need to get more familiar with MonoDevelop. It works when I copy-paste code from a website, but some methods just seems like they won’t autocomplete at all, like the
void OnBecameInvisible() {}
void OnBecameInvisible() {}
I also need to figure out the keyboard shortcuts for starting the game instead of having to click on that tiny button. Peferablydirectly from MonoDevelop.
But this is a common frustration when starting with a new editor =)