Hello i am a Game Development Student from Media College Amsterdam.
I have a little problem with scaling my button texture…
I try’d jumpTexture = new Texture(Screen.Width/2, Screen.height/3);
when i use this it will remove my texture and will fill it with white…
if some one knows how i can scale my texture would be awesome!
my texture code is:
public GUIStyle style;
public Texture2D jumpTexture;
public Texture2D catchTexture;
void Start(){
jumpTexture = new Texture2D(Screen.width/2,Screen.height/3);
}
void OnGUI(){
GUI.skin.button = style;
GUILayout.RepeatButton ("");
if (GUI.RepeatButton (new Rect (20, 0,jumpTexture.width, jumpTexture.height),jumpTexture)) {
print("jumping");
}
}