GPUI - Stage3D based UI

核心理念:

  • 使它尽可能小和简单  
  • 让它调用渲染

整个UI集是单批;)并通过单一drawTriangles呈现……这可能不是很聪明但很有趣!没有动态文本支持,我的意思是你只有标签和标签显示为纹理。蹩脚的但是快,只使用一个纹理整个UI设置!乐趣!;

非常基本的风格体系:

你可以定义默认TextFormat等标签和几个颜色选项的使用背景颜色darkColorlightColor textColor,这……乐趣!,啊是的,你可以使用roundedCorners指定半径:)或不使用...

GPUGUIStyle.setStyle(
                     darkColor:uint, lightColor:uint, bgColor:uint, // default color theme
                     textFormat:TextFormat = null, // define text font and size
                     embedFonts:Boolean = true, // if font is embedded
                     textAntiAlis:String = AntiAliasType.NORMAL, // font alias type
                     textColor:uint = 0xFFFFFFFF, // label color
                     paddX:Number = 3, paddY:Number = 3, // padding between controls
                     controlWidth:Number = 200, controlHeight:Number = 30, // default controls size
                     controlCornerRadius:Number = 0.0 // shapes corner radius
                     ):void;

我是为我的个人需求和创造它不是思考分享结果,因为它太小,也许无法真实世界的问题。但是我认为它快速测试非常有用,因为你可以设置它的自己的Stage3D东西没有包括任何其他框架……

处理事件和得到的结果

control.setCallBack(onCallBack);
function onCallback(...args):void
{
    // u shoulc check specific component what arguments it returns
    // for example GPUGUIColor returns 5 arguments
    // color:uint, red:Number, green:Number, blue:Number, alpha:Number
}

//
// u can also assing properties directly to your objects
//
control.setTarget(target:*, property:String):void

// so when controls value changed it will set
target.property = newValue;

Few Screens to get the feeling

 

posted @ 2015-07-06 11:03  VincentChuChu  阅读(242)  评论(0编辑  收藏  举报