Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
for fgui v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jcyuan committed Dec 1, 2017
1 parent f96985e commit 21d1227
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
18 changes: 6 additions & 12 deletions gui/.objs/workspace.json
@@ -1,21 +1,15 @@
{
"docs": [
"x8x40spb",
"idqru",
"x8x40spb",
"hxib41",
"x8x40spb",
"idqr10",
"expanded_nodes": [
"x8x40spb",
"ntk66t"
"/"
],
"hidden_packages": [],
"active_doc": [
"x8x40spb",
"idqru"
],
"expanded_nodes": [
"docs": [
"x8x40spb",
"/"
]
"idqru"
],
"hidden_packages": []
}
2 changes: 1 addition & 1 deletion gui/settings/Publish.json
Expand Up @@ -10,5 +10,5 @@
},
"fileExtension":"jpg",
"packageCount":2,
"path":"G:\\projects\\laboratory\\FairyGUI-PixiJS-Example\\proj\\dist\\images"
"path":"../proj/dist/images"
}
9 changes: 5 additions & 4 deletions proj/dist/js/Main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proj/dist/js/Main.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions proj/src/Main.ts
Expand Up @@ -37,8 +37,8 @@ class Main extends PIXI.Application {
fgui.GRoot.inst.addChild(this.contentlayer);

this.contentlayer.addChild(this.loadingView = new LoadingView());
this.loadingView.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);
this.loadingView.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);
this.loadingView.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);

//test.jpg actually is a binary file but just ends with fake postfix.
let loader = new fgui.utils.AssetLoader();
Expand All @@ -58,7 +58,7 @@ class Main extends PIXI.Application {
private loadProgress(loader: PIXI.loaders.Loader): void {
let p = loader.progress;
this.loadingView.setProgress(p);
if (p >= 100) {
if (p >= 1) {
loader.off("progress", this.loadProgress, this);
this.loadingView.dispose();
this.loadingView = null;
Expand All @@ -72,6 +72,7 @@ class Main extends PIXI.Application {
fgui.UIPackage.addPackage("test");
let ins = fgui.UIPackage.createObject("test", "main") as fgui.GComponent;
ins.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);
ins.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);
this.contentlayer.addChild(ins);

this.initClicks(ins);
Expand All @@ -86,8 +87,8 @@ class Main extends PIXI.Application {
private initClicks(ins: fgui.GComponent): void {

this.mainIns = ins;
ins.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);
ins.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);
ins.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);
this.container = ins.getChild("container") as fgui.GComponent;

for (let i = 0; i < ins.numChildren; i++) {
Expand Down Expand Up @@ -115,8 +116,8 @@ class Main extends PIXI.Application {
}
this.currentDemo = fgui.UIPackage.createObjectFromURL(`ui://test/${name}`) as fgui.GComponent;
this.currentDemo.name = name;
this.currentDemo.addRelation(this.container, fgui.RelationType.Size);
this.currentDemo.setSize(this.container.width, this.container.height);
this.currentDemo.addRelation(this.container, fgui.RelationType.Size);
this.container.addChild(this.currentDemo);
this.initDemo(name, this.currentDemo);
this.mainIns.getController("c1").selectedIndex = 1;
Expand Down

0 comments on commit 21d1227

Please sign in to comment.