OnMouse functions not working properly on GUITexture when changing viewport rect

When I change Normalized View Port Rect width or height of my main camera, the active area of mouse event functions like OnMouseEnter and OnMouseExit on GUITexture objects is not correctly placed over the image.

For example, if I reduce the width of the Normalized View Port Rect, the active area of my GUITexture is shifted to the left.

I do not want to use GUI scripts even if I know how to use them.

#Example

##Description

In the example Unity file from the link below, when I point the mouse cursor above the image, it should normally have its alpha color changed. But in this case, with a modified Normalized View Port Rect (width = 0.5), this only happens when I point at the left of the image.

##Link

Here it is

##Script

#pragma strict

function OnMouseEnter() {guiTexture.color.a = 0.1;}

function OnMouseExit() {guiTexture.color.a = 1.0;}

#Question

Is it a bug ? How can I workaround ?

#Update log

[Update]
Added on GUITexture objects in the first paragraph.

[Update 2]
Added link to an example export.

[Update 3]
Added script used + formatting the question.

Yes, this looks like a big fat bug! I tested this, and the “sensible” area moved down and left - even when the viewport was set to the upper right corner.

The 3 bastard sons of Unity are TextMesh, GUIText and GUITexture. Many things with them are weird: TextMesh Z axis points backwards, its shader renders over everything in the 3D world, GUIText and GUITexture use viewport coordinates in the position field, ignore rotation and have an undecipherable interpretation of scale, GUIText doesn’t have a color property… there are many weird things, and this bug comes to make things worse.

If the sensible area of your texture may be simplified to a rectangle, you can define some sensible rectangles and use Rect.Contains(Input.mousePosition) to check when the mouse entered them:

var r1:Rect = Rect(10,10,200,100);
var r2:Rect = Rect(300,10,200,100);

function Update(){
  if (r1.Contains(Input.mousePosition)){
    // mouse over r1
  } else {
    // mouse out of r1
  }
  if (r2.Contains(Input.mousePosition)){
    // mouse over r2
  } else {
    // mouse out of r2
  }
}

The alternative is the new GUI system, which you seem to hate (I don’t like it too…)