Added : RiderCardDrawer
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package components;
|
||||
|
||||
import openfl.display.Bitmap;
|
||||
import openfl.system.ApplicationDomain;
|
||||
import openfl.system.LoaderContext;
|
||||
import openfl.display.LoaderInfo;
|
||||
@@ -55,10 +56,10 @@ class RoundAvatar extends LayoutGroup {
|
||||
mask = m;
|
||||
|
||||
var l:Loader = new Loader();
|
||||
var lc:LoaderContext = new LoaderContext(true, null);
|
||||
//var lc:LoaderContext = new LoaderContext(true, null);
|
||||
// l.load(new URLRequest("https://ui-avatars.com/api/?background=random&size=64"));
|
||||
//l.load(new URLRequest("https://api.dicebear.com/9.x/pixel-art/png?size=32"));
|
||||
l.load(new URLRequest("https://lepetittrot.com/lptcm/assets/profile-pictures/pp256/pp_malo.jpeg"), lc);
|
||||
l.load(new URLRequest("https://lepetittrot.com/lptcm/assets/profile-pictures/pp256/pp_malo.jpeg"));
|
||||
l.contentLoaderInfo.addEventListener (Event.COMPLETE, onLoadComplete);
|
||||
addChild(l);
|
||||
|
||||
@@ -67,7 +68,9 @@ class RoundAvatar extends LayoutGroup {
|
||||
private function onLoadComplete(e:Event) {
|
||||
|
||||
var l:Loader = cast(e.currentTarget, LoaderInfo).loader;
|
||||
l.content.width = l.content.height = avatarSize;
|
||||
var bmp:Bitmap = e.currentTarget.content;
|
||||
bmp.smoothing = true;
|
||||
l.content.width = l.content.height = avatarSize;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user