Allow transparent window background
This commit is contained in:
@@ -64,7 +64,7 @@ class HTML5Renderer {
|
||||
|
||||
var options = {
|
||||
|
||||
alpha: false,
|
||||
alpha: (Reflect.hasField (parent.window.config, "background") && parent.window.config.background == null) ? true : false,
|
||||
antialias: Reflect.hasField (parent.window.config, "antialiasing") ? parent.window.config.antialiasing > 0 : false,
|
||||
depth: Reflect.hasField (parent.window.config, "depthBuffer") ? parent.window.config.depthBuffer : true,
|
||||
premultipliedAlpha: false,
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef WindowConfig = {
|
||||
|
||||
@:optional var allowHighDPI:Bool;
|
||||
@:optional var antialiasing:Int;
|
||||
@:optional var background:Int;
|
||||
@:optional var background:Null<Int>;
|
||||
@:optional var borderless:Bool;
|
||||
@:optional var depthBuffer:Bool;
|
||||
@:optional var display:Int;
|
||||
|
||||
@@ -1784,7 +1784,15 @@ class ProjectXMLParser extends HXProject {
|
||||
|
||||
}
|
||||
|
||||
windows[id].background = Std.parseInt (value);
|
||||
if (value == "0x" || (value.length == 10 && StringTools.startsWith (value, "0x00"))) {
|
||||
|
||||
windows[id].background = null;
|
||||
|
||||
} else {
|
||||
|
||||
windows[id].background = Std.parseInt (value);
|
||||
|
||||
}
|
||||
|
||||
case "orientation":
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ typedef WindowData = {
|
||||
@:optional var height:Int;
|
||||
@:optional var x:Float;
|
||||
@:optional var y:Float;
|
||||
@:optional var background:Int;
|
||||
@:optional var background:Null<Int>;
|
||||
@:optional var parameters:String;
|
||||
@:optional var fps:Int;
|
||||
@:optional var hardware:Bool;
|
||||
|
||||
@@ -67,7 +67,7 @@ class System {
|
||||
|
||||
var color = null;
|
||||
|
||||
if (background != null) {
|
||||
if (background != null && background != "") {
|
||||
|
||||
background = StringTools.replace (background, "#", "");
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class HTML5Platform extends PlatformTarget {
|
||||
|
||||
var context = project.templateContext;
|
||||
|
||||
context.WIN_FLASHBACKGROUND = StringTools.hex (project.window.background, 6);
|
||||
context.WIN_FLASHBACKGROUND = project.window.background != null ? StringTools.hex (project.window.background, 6) : "";
|
||||
context.OUTPUT_DIR = targetDirectory;
|
||||
context.OUTPUT_FILE = outputFile;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user