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

 

转载于:https://www.cnblogs.com/VincentChuChu/p/4623805.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值