Показать сообщение отдельно
Старый 31.07.2011, 18:19   #495
SaM_
ПроЭктировщик
 
Аватар для SaM_
 
Регистрация: 15.06.2011
Сообщений: 111
Написано 2 полезных сообщений
(для 3 пользователей)
Ответ: Фак по Юнити.

Разобрался.
Плюс нашел вот такой скрипт:
/* Using multiple Groups to clip the displayed Contents */

var bgImage : Texture2D; // background image that is 256 x 32
var fgImage : Texture2D; // foreground image that is 256 x 32
var playerEnergy = 1.0; // a float between 0.0 and 1.0

function OnGUI () {
    
// Create one Group to contain both images
    // Adjust the first 2 coordinates to place it somewhere else on-screen
    
GUI.BeginGroup (Rect (0,0,256,32));

    
// Draw the background image
    
GUI.Box (Rect (0,0,256,32), bgImage);

    
// Create a second Group which will be clipped
    // We want to clip the image and not scale it, which is why we need the second Group
    
GUI.BeginGroup (Rect (0,0,playerEnergy * 256, 32));

    
// Draw the foreground image
    
GUI.Box (Rect (0,0,256,32), fgImage);

    
// End both Groups
    
GUI.EndGroup ();
    
GUI.EndGroup ();
} 
(Offline)
 
Ответить с цитированием