Prechádzať zdrojové kódy

allow loading resources from res:// (close #75)

Nicolas Cannasse 10 rokov pred
rodič
commit
be4e761c12
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      h2d/css/Parser.hx

+ 3 - 1
h2d/css/Parser.hx

@@ -560,6 +560,8 @@ class Parser {
 	function getImage( v : Value ) {
 		switch( v ) {
 		case VCall("url", [VString(url)]):
+			if( StringTools.startsWith(url, "res://") )
+				return hxd.res.Loader.currentInstance.load(url.substr(6)).toImage().getPixels();
 			if( !StringTools.startsWith(url, "data:image/png;base64,") )
 				return null;
 			url = url.substr(22);
@@ -1025,4 +1027,4 @@ class Parser {
 		return null;
 	}
 
-}
+}