rect with different resoultion

hello everyone,

i have a script for steering wheel i want to scale the texture to different resolutions

it looks like this
alt text

alt text

alt text

alt text

alt text

but what i want like this

alt text

alt text

alt text

alt text

alt text

alt text

#pragma strict
public var maximumAngle : float = 180f; // Maximum angle the steering wheel can rotate
public var wheelSize : float = 256f; // Wheel's width (and height) as pixel
public var deltaPivot : Vector2 = Vector2.zero; // If wheel not rotates around its center, this variable allows tweaking the pivot point
public var wheelFreeSpeed : float = 200f; // Degrees per second the wheel rotates when released
public var wheelTexture : Texture2D; // Wheel texture
private var wheelAngle : float; // Wheel's angle in degrees
private var wheelBeingHeld : boolean; // Whether or not the steering wheel is being held
private var wheelPosition : RectTransform; // Wheel's position on screen
private var wheelCenter : Vector2; // Wheel's center on screen coordinates (not Rect coordinates)
private var wheelTempAngle : float; // A necessary variable
function Start()
{
    // Initialize variables and calculate wheel's position on screen
    wheelBeingHeld = false;
    wheelPosition = new Rect( 25,Screen.height - 450, wheelSize, wheelSize );
    wheelCenter = new Vector2( wheelPosition.x + wheelPosition.width * 0.5f, Screen.height - wheelPosition.y - wheelPosition.height * 0.5f );
    wheelAngle = 0f;
}
// Returns the angle of the steering wheel in degrees. Can be used to rotate a car etc.
public function GetAngle()
{
    return wheelAngle;
}
function Update()
{
    // Show the rotation on console
 
    // If the wheel is currently being held
    if( wheelBeingHeld )
    {
        var mousePosition : Vector2;
        // Find the mouse position on screen
        mousePosition = Input.mousePosition;
         
        var wheelNewAngle : float = Vector2.Angle( Vector2.up, mousePosition - wheelCenter );
     
        // If mouse is very close to the steering wheel's center, do nothing
        if( Vector2.Distance( mousePosition, wheelCenter ) > 20f )
        {
            if( mousePosition.x > wheelCenter.x )
                wheelAngle -= wheelNewAngle - wheelTempAngle;
            else
                wheelAngle += wheelNewAngle - wheelTempAngle;
        }
     
        // Make sure that the wheelAngle does not exceed the maximumAngle
        if( wheelAngle > maximumAngle )
            wheelAngle = maximumAngle;
        else if( wheelAngle < -maximumAngle )
            wheelAngle = -maximumAngle;
     
        wheelTempAngle = wheelNewAngle;
     
        // If user releases the mouse, release the wheel
        if( Input.GetMouseButtonUp( 0 ) )
            wheelBeingHeld = false;
    }
    else // If wheel is not being held
    {
        // If user clicks on the wheel, update the status
        if( Input.GetMouseButtonDown( 0 ) && wheelPosition.Contains( new Vector2( Input.mousePosition.x, Screen.height - Input.mousePosition.y ) ) )
        {
            wheelBeingHeld = true;
            wheelTempAngle = Vector2.Angle( Vector2.up, Input.mousePosition - wheelCenter );
        }
     
        // If the wheel is rotated and not being held, rotate it to its default angle (zero)
        if( !Mathf.Approximately( 0f, wheelAngle ) )
        {
            var deltaAngle : float = wheelFreeSpeed * Time.deltaTime;
         
            if( Mathf.Abs( deltaAngle ) > Mathf.Abs( wheelAngle ) )
            {
                wheelAngle = 0f;
                return;
            }
         
            if( wheelAngle > 0f )
                wheelAngle -= deltaAngle;
            else
                wheelAngle += deltaAngle;
        }
    }
}
// Draw the steering wheel on screen
function OnGUI()
{
    // Uncomment the line below to see the bounds of the wheel
   GUI.Box( wheelPosition, "" );
 
    var theMatrix : Matrix4x4 = GUI.matrix;
    GUIUtility.RotateAroundPivot( -wheelAngle, wheelPosition.center + deltaPivot );
    GUI.DrawTexture( wheelPosition, wheelTexture );
    GUI.matrix = theMatrix;
}

Unity 4.6 UI makes this task easier than ever, simply manipulate the pivot point & set the scale mode. If you are just starting there’s no reason to work with OnGUI() for non editors.