- Home /
Use Sprites as Score
So basscily i want to use my sprites for score and upgrade cost and etc on my 2d game just like in the ui text display i dont know how to write the code tho i have a small idea but i clearly cannot write such code. I dont know why but i cannot find an answer enywhere to i looked up alot ! And dont tell me about bitmap fonts since for some reason my ui doesnt scale properly with my camera i belive its because of this script i put on my cam
public class CameraResolutionFix : MonoBehaviour {
public float orthographicSize = 5;
public float aspect = 1.33333f;
void Start()
{
Camera.main.projectionMatrix = Matrix4x4.Ortho(
-orthographicSize * aspect, orthographicSize * aspect,
-orthographicSize, orthographicSize,
GetComponent<Camera>().nearClipPlane, GetComponent<Camera>().farClipPlane);
}
}
if u find a solution for either the scaling or maybe find a code or tutorial for the sprite to score i will be very thankfull !
Comment