bright-gpu-74537
02/07/2023, 11:11 PMbright-gpu-74537
02/07/2023, 11:12 PMicy-zebra-52882
02/07/2023, 11:13 PMicy-zebra-52882
02/07/2023, 11:13 PMbright-gpu-74537
02/07/2023, 11:13 PMicy-zebra-52882
02/07/2023, 11:14 PMbright-gpu-74537
02/08/2023, 8:21 AMbumpy-engineer-49082
02/08/2023, 8:38 AMpublic function render(framebuffers:Array<Framebuffer>):Void {
_backgroudColor = ColorUtil.parseColor(Toolkit.backendProperties.getProp("haxe.ui.kha.background.color", "0xFFFFFF"));
var g = framebuffers[0].g2;
g.begin(true, _backgroudColor);
Screen.instance.renderTo(g);
g.end();
}
bumpy-engineer-49082
02/08/2023, 8:40 AMbright-gpu-74537
02/08/2023, 8:41 AMbumpy-engineer-49082
02/08/2023, 8:42 AMpackage;
import haxe.ui.HaxeUIApp;
import haxe.ui.Toolkit;
import haxe.ui.components.Button;
import haxe.ui.containers.dialogs.Dialog;
import haxe.ui.core.Component;
import haxe.ui.core.Screen;
import haxe.ui.macros.ComponentMacros;
import haxe.ui.themes.Theme;
import haxe.ui.util.ColorUtil;
import kha.Assets;
import kha.Assets;
import kha.Color;
import kha.Framebuffer;
import kha.Framebuffer;
import kha.Scheduler;
import kha.System;
class Main {
private var _callback:Void->Void;
private var _backgroudColor:Int = 0;
static function update():Void {}
public function render(framebuffers:Array<Framebuffer>):Void {
_backgroudColor = ColorUtil.parseColor(Toolkit.backendProperties.getProp("haxe.ui.kha.background.color", "0xFFFFFF"));
var g = framebuffers[0].g2;
g.begin(true, _backgroudColor);
Screen.instance.renderTo(g);
g.end();
}
public static function main() {
kha.System.start({}, function(_) {
kha.Assets.loadEverything(function() {
haxe.ui.Toolkit.init();
final screen = haxe.ui.core.Screen.instance;
final ui = haxe.ui.ComponentBuilder.fromFile("main-view.xml");
screen.addComponent(ui);
System.start({title: "Project", width: 1024, height: 768}, function(_) {
// Just loading everything is ok for small projects
Assets.loadEverything(function() {
// Avoid passing update/render directly,
// so replacing them via code injection works
Scheduler.addTimeTask(function() {
update();
}, 0, 1 / 60);
System.notifyOnFrames(function(frames) {});
});
});
});
});
}
}
bumpy-engineer-49082
02/08/2023, 8:42 AMbright-gpu-74537
02/08/2023, 8:42 AMbright-gpu-74537
02/08/2023, 8:43 AMSystem.notifyOnFrames(function(frames) {});
is just calling an empty functionbright-gpu-74537
02/08/2023, 8:43 AMpublic function render(framebuffers:Array<Framebuffer>):Void {
to public static function render(framebuffers:Array<Framebuffer>):Void {
bright-gpu-74537
02/08/2023, 8:44 AMSystem.notifyOnFrames(function(frames) {});
to System.notifyOnFrames(render);
powerful-morning-89
02/08/2023, 8:44 AM0xFFFFFF
is white, but with alpha = 0
. That probably won't give the results you expect.bright-gpu-74537
02/08/2023, 8:45 AMrender
is never being called (and its not static)bumpy-engineer-49082
02/08/2023, 8:49 AMbright-gpu-74537
02/08/2023, 8:49 AMbright-gpu-74537
02/08/2023, 8:50 AMbright-gpu-74537
02/08/2023, 8:51 AMbright-gpu-74537
02/08/2023, 8:52 AMpowerful-morning-89
02/08/2023, 8:52 AMbumpy-engineer-49082
02/08/2023, 8:53 AMbright-gpu-74537
02/08/2023, 8:54 AMearly-butcher-76809
02/08/2023, 12:59 PM<vbox id="vbox">
<style>
.btnStyle {
background-opacity: 0;
border-opacity: 0;
}
</style>
<button id="act0" styleName="btnStyle" />
</vbox>
In StyleHelper.hx (l 47), this test is true, although I haven't touched this properties (probably set and different from each other by default) :
if (style.backgroundColorEnd != null && style.backgroundColor != style.backgroundColorEnd)
The use of opacity is in the else of that previous test, thus it's never called :(
Is it intended ?bright-gpu-74537
02/08/2023, 1:01 PMbright-gpu-74537
02/08/2023, 1:03 PMbright-gpu-74537
02/08/2023, 1:04 PM