added readme
This commit is contained in:
62
README.md
Executable file
62
README.md
Executable file
@@ -0,0 +1,62 @@
|
|||||||
|
# haxework
|
||||||
|
|
||||||
|
Gui framework for Haxe.
|
||||||
|
|
||||||
|
## View
|
||||||
|
|
||||||
|
`haxework.gui` provides views classes.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Build form using `haxework.gui.ViewBuilder`.
|
||||||
|
|
||||||
|
form.json:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type":"haxework.gui.VGroupView",
|
||||||
|
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0xffff00"}
|
||||||
|
"paddings":20,
|
||||||
|
"layoutMargin":10,
|
||||||
|
"views":[
|
||||||
|
{
|
||||||
|
"id":"view1",
|
||||||
|
"type":"haxework.gui.SpriteView",
|
||||||
|
"pWidth":100, "pHeight":100,
|
||||||
|
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0xff0000"}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"id":"view2",
|
||||||
|
"type":"haxework.gui.SpriteView",
|
||||||
|
"pWidth":100, "height":50,
|
||||||
|
"skin":{"type":"haxework.gui.skin.ColorSkin", "color":"0x00ff00"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```haxe
|
||||||
|
@:template("form.json")
|
||||||
|
class FormView extends VGroupView implements ViewBuilder {}
|
||||||
|
|
||||||
|
var form = new FormView();
|
||||||
|
Root.bind(form); // Add form to stage as root view element.
|
||||||
|
trace(form.view1);
|
||||||
|
trace(form.view2);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Loader
|
||||||
|
|
||||||
|
`haxework.net` provides loaders classes.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```haxe
|
||||||
|
new JsonLoader().GET("http://example.com/file.json")
|
||||||
|
.then(function(data) {
|
||||||
|
trace("Json Ok: " + data);
|
||||||
|
})
|
||||||
|
.catchError(function(error) {
|
||||||
|
trace("Json Fail: " + error);
|
||||||
|
});
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user