Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspirit/GPUI
tiny GPU [Stage3D] based GUI
https://github.com/inspirit/GPUI
Last synced: 3 months ago
JSON representation
tiny GPU [Stage3D] based GUI
- Host: GitHub
- URL: https://github.com/inspirit/GPUI
- Owner: inspirit
- Created: 2012-05-02T17:14:09.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-03T17:44:00.000Z (over 12 years ago)
- Last Synced: 2024-05-03T05:14:08.975Z (6 months ago)
- Language: ActionScript
- Size: 242 KB
- Stars: 70
- Watchers: 9
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actionscript-sorted - GPUI - tiny GPU [Stage3D] based GUI (User Interface / UI Components)
README
GPUI - Stage3D based UI
==
**Core ideas:**
+ make it as tiny and simple as possible
+ make it single call render> yes the whole UI set is single batch ;) and rendered via single `drawTriangles`... that's probably not very smart but fun!
there is no dynamic text support, i mean u only have labels, and labels are rendered as textures. lame but fast and uses only one `Texture` for whole UI set! fun! ;)**Very basic style system:**
u can define default `TextFormat` to use for labels and several color options like
`bgColor` `darkColor` `lightColor` `textColor`
and thats it... fun! ;)
ahh yes and u can use `roundedCorners` with specified radius :) or dont use...
```
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;
```
> well i was creating it for my personal needs and wasn't thinking about sharing the result since it is too small and maybe unusable for real world problems.
but i think it is quite useful for quick tests because u can setup it on top of your own `Stage3D` stuff without including any other frameworks...**Handle events and getting results**
```
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**
Copyright 2012 Eugene ZatepyakinLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.