1
Support / Re: TextMesh size in pixels
« on: May 27, 2015, 10:47:37 am »Yup thats it. Its not 100% accurate as the name suggests but its very very closeClose enough for me. Just add an extra 10px and it should be fine (I hope )
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.
Yup thats it. Its not 100% accurate as the name suggests but its very very closeClose enough for me. Just add an extra 10px and it should be fine (I hope )
Thank you...
I've figured it out - After learning how to make it was pretty easy actually.
It is already two sprites of course, the knife is its own sprite while the rope is a tiled sprite
What you've said is exactly the same as what I said except just reversed. Even if I keep the anchor of the rope on the knife I still need to extend the dimension.x value but in relation to the character instead of the knife.
using UnityEngine;
using System.Collections;
public class OptionMenu : MonoBehaviour
{
public tk2dCamera myCamera;
static private tk2dSprite myObject;
byte MyMenuOption;
// Use this for initialization
void Start ()
{
Vector3 StartPos;
myObject=GetComponent<tk2dSprite>();
StartPos=myObject.transform.position;
if(StartPos.x==myCamera.nativeResolutionWidth/2 && StartPos.y==myCamera.nativeResolutionHeight-50)
{
// TetraGems logo
myObject.SetSprite(2);
MyMenuOption=1;
}
else if(StartPos.x==myCamera.nativeResolutionWidth/2 && StartPos.y==100)
{
// Start button
myObject.SetSprite(3);
MyMenuOption=2;
}
else if(StartPos.x==myCamera.nativeResolutionWidth-75 && StartPos.y==0)
{
// Exit button
myObject.SetSprite(6);
MyMenuOption=3;
}
else if(StartPos.x==125 && StartPos.y==myCamera.nativeResolutionHeight/2+100)
{
// Next Blocks button
myObject.SetSprite(8);
myObject.transform.Rotate(0f,0f,350);
MyMenuOption=4;
}
else if(StartPos.x==125 && StartPos.y==myCamera.nativeResolutionHeight/2-50)
{
// Next Gems button
myObject.SetSprite(10);
myObject.transform.Rotate(0f,0f,10);
MyMenuOption=5;
}
else if(StartPos.x==myCamera.nativeResolutionWidth-125 && StartPos.y==myCamera.nativeResolutionHeight/2+100)
{
// Music button
myObject.SetSprite(12);
myObject.transform.Rotate(0f,0f,350);
MyMenuOption=6;
}
else if(StartPos.x==myCamera.nativeResolutionWidth-125 && StartPos.y==myCamera.nativeResolutionHeight/2-50)
{
// Sound Effects button
myObject.SetSprite(14);
myObject.transform.Rotate(0f,0f,10);
MyMenuOption=7;
}
else if(StartPos.x==75 && StartPos.y==0)
{
// Credits button
myObject.SetSprite(15);
MyMenuOption=8;
}
if(MyMenuOption>2)
{
myObject.scale=new Vector3(1.5f,1.5f,1.5f);
}
else if (MyMenuOption==2)
{
myObject.scale=new Vector3(2f,2f,2f);
}
}
// Update is called once per frame
void Update ()
{
if(MyMenuOption>0 && MainGame.GameState>=20)
{
// Game no longer in menu mode - destroy object
DestroyImmediate(gameObject);
}
}
void OnMouseDown()
{
switch(MyMenuOption)
{
case 2: // Play
MainGame.GameState=20;
break;
case 3: // Exit
Application.Quit();
break;
case 4: // Next Blocks
myObject.SetSprite(9);
break;
case 5: // Next Gems
myObject.SetSprite(11);
break;
case 6: // Music
myObject.SetSprite(13);
break;
case 7: // Sound Effects
myObject.SetSprite(15);
break;
case 8:
break;
}
}
}