Hello, I use a piece of code that is supposed to enlarge a small tab in a larger area of information (all hover).
The code works but also by reducing the value of magnification tab moves from position to position “unfolded” instantly … GUI does not run to the enterFrame?
private float _Wacceuil = 40;//valeurs références par défaut
private float _Hacceuil = 50;
private float _WacceuilOFF = 40;//valeurs références d'origines, position plié
private float _HacceuilOFF = 50;
private float _WacceuilON = 100;//valeurs références d'origines, position déplié
private float _HacceuilON = 250;
GUI.Button(new Rect(0, 60, _Wacceuil, _Hacceuil), "Acceuil");
if (Input.mousePosition.x>0&&Input.mousePosition.y<Screen.height-60 &&
Input.mousePosition.x<0+_Wacceuil &&
Input.mousePosition.y>Screen.height-60-_Hacceuil)
{
while(_Wacceuil < _WacceuilON)
{
_Wacceuil += .1f;
}
while(_Hacceuil < _HacceuilON)
{
_Hacceuil += .1ff;
}
}
else
{
if(_Wacceuil > _WacceuilOFF)
{
while(_Wacceuil > _WacceuilOFF)
{
_Wacceuil -= .1f;
}
}
if(_Hacceuil > _HacceuilOFF)
{
while(_Hacceuil > _HacceuilOFF)
{
_Hacceuil -= .1f;
}
}
}