进度条

时间:2014-05-10 01:28:36   收藏:0   阅读:440

EditorGUI.ProgressBar 进度条

static function ProgressBar (position : Rectvalue : float, text : string) : void

Parameters参数

Description描述

Make a progress bar.

制作一个进度条。

Value goes from 0 to 1, where 0 means 0% of the bar filled and 1 means the bar is at 100% fully filled

从0到1;0表示0%,1表示100%满条。

bubuko.com,布布扣

Progress bar in an Editor Window. 
编辑器中的进度条。

bubuko.com,布布扣
// Draw the damage and the armor with bars in an Editor Window
//在编辑器绘制伤害和盔甲的状态
        
class EditorGUIProgressBar extends EditorWindow {

    var armor : int = 20;
    var damage : int = 80;

    @MenuItem("Examples/Display Info")
    static function Init() {
        var window = GetWindow(EditorGUIProgressBar);
        window.Show();
    }

    function OnGUI() {
        armor = EditorGUI.IntSlider(Rect(3,3,position.width-6,15), "Armor:", armor, 0, 100);
        damage = EditorGUI.IntSlider(Rect(3,25,position.width-6,15), "Damage:", damage, 0, 100);

        EditorGUI.ProgressBar(Rect(3,45,position.width-6,20),armor/100.0, "Armor");
        EditorGUI.ProgressBar(Rect(3,70,position.width-6,20),damage/100.0, "Damage");

    }
}
bubuko.com,布布扣

 

进度条,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!