Texture2D Width problem - C# Android school project

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! :smiley:

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");
				
  }
}

You can assign background texture to your button with a GUIStyle in the inspector

I have found it i use Resize now but that didnt worked because i didnt made the settings readable… Thanks for your help Killian227