bright-gpu-74537
12/29/2020, 7:52 PMdry-hydrogen-97705
12/29/2020, 7:53 PMspriteContainer shows in the right place, and has the right size, but the image is not inside the spriteContainerbright-gpu-74537
12/29/2020, 7:57 PMbright-gpu-74537
12/29/2020, 7:57 PMbright-gpu-74537
12/29/2020, 7:57 PMdry-hydrogen-97705
12/29/2020, 7:57 PMbright-gpu-74537
12/29/2020, 7:58 PMbright-gpu-74537
12/29/2020, 7:59 PMbright-gpu-74537
12/29/2020, 7:59 PMdry-hydrogen-97705
12/29/2020, 8:00 PMbright-gpu-74537
12/29/2020, 8:00 PMbright-gpu-74537
12/29/2020, 8:00 PMbright-gpu-74537
12/29/2020, 8:05 PMbright-gpu-74537
12/29/2020, 8:05 PMhaxe
class SpriteContainer extends Component {
private var sprite:FlxSprite;
public function new() {
super();
sprite = new FlxSprite();
sprite.makeGraphic(50, 50, FlxColor.BLUE);
add(sprite);
}
private override function repositionChildren() {
super.repositionChildren();
sprite.x = this.screenLeft;
sprite.y = this.screenTop;
}
}bright-gpu-74537
12/29/2020, 8:06 PMdry-hydrogen-97705
12/29/2020, 8:08 PMhaxe
for (c in this){
c.x = this.screenLeft;
c.y = this.screenTop;
}dry-hydrogen-97705
12/29/2020, 8:08 PMbright-gpu-74537
12/29/2020, 8:17 PMbright-gpu-74537
12/29/2020, 8:17 PMbright-gpu-74537
12/29/2020, 8:18 PMbright-gpu-74537
12/29/2020, 8:18 PMdry-hydrogen-97705
12/29/2020, 8:23 PMbright-gpu-74537
12/29/2020, 8:39 PMbright-gpu-74537
12/29/2020, 8:39 PMbright-gpu-74537
12/29/2020, 8:40 PMhaxe
class BaseDialog extends Dialog {
public function new() {
super();
buttons = DialogButton.OK | "Bob";
}
}bright-gpu-74537
12/29/2020, 8:40 PMxml
<dialog title="${title}">
<hbox width="100%">
<label width="120" text="Shared field 1" verticalAlign="center" />
<textfield width="100%" />
</hbox>
<import source="${contents}" />
<hbox width="100%">
<label width="120" text="Shared field 2" verticalAlign="center" />
<textfield width="100%" />
</hbox>
</dialog>bright-gpu-74537
12/29/2020, 8:40 PMhaxe
@:build(haxe.ui.macros.ComponentMacros.build("assets/base-dialog.xml", {title: "Dialog1", contents: "contents1.xml"}))
class Dialog1 extends BaseDialog {
public function new() {
super();
}
}bright-gpu-74537
12/29/2020, 8:41 PMxml
<hbox width="100%">
<label width="120" text="Contents 1 field A" verticalAlign="center" />
<textfield width="100%" />
</hbox>bright-gpu-74537
12/29/2020, 8:41 PMhaxe
@:build(haxe.ui.macros.ComponentMacros.build("assets/base-dialog.xml", {title: "Dialog2", contents: "contents2.xml"}))
class Dialog2 extends BaseDialog {
public function new() {
super();
}
}bright-gpu-74537
12/29/2020, 8:41 PM