- Home /
Question by
aleem.razzaq09 · Dec 11, 2012 at 06:09 AM ·
gameobjecttexture2d
How to set image in Aspect fit on Texture2D
Hi I am new bee in Unity and I am working on an app in which i want to load my Images in Aspect fit ratio on Texture. I Know that i can achieve this using ScaleMode.ScaleToFit but i am not getting this property in Texture 2d. I am doing following like this.
video.mIconPlane.renderer.material.mainTexture = tex; video.mIconPlane.transform.rotation=Quaternion.AngleAxis(180, Vector3.up); video.mIconPlane.transform.localScale = ScaleMode.ScaleToFit; Video is the Object of my VideoClass and mIconPlane is public Game Object in Video Class. This will be great for me. Thanks in advance.Texture2D tex = Resources.Load("ImageTargetTextures/WhatTheBuck/MYPicture") as Texture2D;
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613085248im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity Texture import Setting For Android Game 0 Answers
Sporadic Failure of GetComponentInChildren 0 Answers
Hide the ImageTraget in Real world 0 Answers
How draw a path using touch in c# 1 Answer