2D Toolkit Forum
2D Toolkit => Support => Topic started by: kag359six on July 03, 2013, 01:31:45 am
-
I'm having trouble with the GUI system in Toolkit2D. Say I have a text mesh for score keeping in game, how can I get stuff like buttons, menu's etc. to keep the same screen position when the camera zooms in and out? Is it possible?
-
Use the anchor to keep things anchored to a specific screen position. If you're using a normal camera, and not a tk2dCamera, you can use the new anchor system from tk2d 2.1 - a preview is available from here in the private support forum: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1987.0.html
-
When I go to the link it tells me "The topic or board you are looking for appears to be either missing or off limits to you."
-
Its in the private support forum. You'll need to register your 2D Toolkit as described here to get access: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,34.0.html
-
When I import the anchor package, it seems that the two editor scripts crash Unity just like it did for profanicus. For me, however, it crashes when I import either the tk2dCameraEditor.cs OR the tk2dCameraAnchorEditor.cs. I have no clue what the issue is.
-
In fact, Unity is practically unusable now. Every time I try searching for the files to delete it Unity crashes. My tabs are all out of place as well. What in the world happened?
-
Unity does occasionally go mad sometimes when importing new packages. Try this - shut down unity, delete the offending files in explorer / finder, restart Unity, shut down (important) and restart it again - import the package again and let it import the missing files.
-
When I import the anchor package, it seems that the two editor scripts crash Unity just like it did for profanicus. For me, however, it crashes when I import either the tk2dCameraEditor.cs OR the tk2dCameraAnchorEditor.cs. I have no clue what the issue is.
Yep this happened for me with the anchor package, and again with the 2.1 beta as well. After it crashes, manually deleting the camera editor files in explorer and re-importing worked for me.
-
I THINK it works... but the tk2dCameraAnchor script bugs out like crazy on a normal orthographic camera. It automatically places the positioning of an item 80 units behind its original position before adding the script, and it also won't let me increase the Z position value of the sprite text. It only decreases no matter the direction I scroll.
-
Make sure the anchor is the child of the ui camera. Ideally make the anchor through the Create menu rather than adding component, as tk2d then forces you to stick it on a camera.
-
Why does the text mesh (which I'm assuming is suppose to be a child of the anchor) resize when I zoom in with the camera by changing the orthographic size?
-
Changing the orthographic size changes what the camera sees. The text mesh remains the same size, the camera sees more = Looks like the text mesh is changing size. If you want to zoom in, set up a second UI camera separately so you don't mess about with the UI. Check sample 6 to see how you can use 2 cameras.
-
Were can I find sample 6?
-
Sample 6 is probably in TK2DROOT/tk2d_demo
-
Oh my apologies I was looking for it on the forum :P duh.