Friday, January 23, 2015

AdvAlert AS3 class Download and How To Use Part 6

Here you can find a couple of AdvAlert window skin examples that you can use in your games and applications.

Below are 4 skins I made that you can use in your AdvAlert powered alert windows. To implement them, use the the code below each example image.




var mySkin:AdvAlertSkin = new AdvAlertSkin();
mySkin.bgRect = new SolidColorRect(0xe2e2e2, [5, 5, 5, 5], 1);
mySkin.bgStroke = new SolidColorStroke(1, 0x000000, 0);
mySkin.headerHeight = 34;
mySkin.headerRect = new SolidColorRect(0x99ccff, [5, 5, 0, 0], 1);
mySkin.headerPadding = new TextPadding(0, 0, 0, 0);
mySkin.titleFormat = new TextFormat("Verdana", 22, 0xffffff);
mySkin.titleFilters = [new DropShadowFilter(1, 45, 0x000000, 0.7, 0, 0)];
mySkin.textFormat = new TextFormat("Verdana", 15, 0x111111);
mySkin.blurColor = 0x000000;
mySkin.buttonbarPadding.bottom = 0;

var myButtonSkin:AdvAlertButtonSkin = new AdvAlertButtonSkin();
myButtonSkin.bgRect = new SolidColorRect(0x99ccff, [5, 5, 0, 0], 1);
myButtonSkin.bgStroke = new SolidColorStroke(1, 0x000000, 0);
myButtonSkin.textFormat = new TextFormat("Verdana", 17, 0xffffff, null, null, null, null, null, "center" );
myButtonSkin.textFilters = [new DropShadowFilter(1, 45, 0x000000, 0.7, 0, 0)];
myButtonSkin.hover_bgRect = new SolidColorRect(0x7799bb, [5, 5, 0, 0], 1);
myButtonSkin.hover_bgStroke = new SolidColorStroke(1, 0x000000, 0);
myButtonSkin.hover_textFormat = new TextFormat("Verdana", 17, 0xffffff, null, null, null, null, null, "center" );
myButtonSkin.hover_textFilters = [new DropShadowFilter(1, 45, 0x000000, 0.7, 0, 0)];

AlertManager = new AdvAlertManager(this, stage, mySkin, myButtonSkin, null, true, 400);
var myAlert:AdvAlertWindow = AlertManager.alert("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "Title", [new AdvAlertButton("OK"), new AdvAlertButton("Cancel")]);



var mySkin:AdvAlertSkin = new AdvAlertSkin();
var bgMatrix:Matrix = new Matrix();
bgMatrix.createGradientBox(200, 200, 1.57, 100, 100);
mySkin.bgRect = new GradientColorRect(GradientType.LINEAR, [0x000000, 0x444444], [1, 1], [0, 255], bgMatrix, "pad", "rgb", 0, [0, 0, 0, 0]);
mySkin.bgStroke = new SolidColorStroke(2, 0xeeeeee);
mySkin.headerRect = new SolidColorRect(0x000000, null, 0);
mySkin.headerPadding = new TextPadding(5, 0, 0, 0);
mySkin.titleFormat.align = "center";
mySkin.titleFormat.size = 22;

var myButtonSkin:AdvAlertButtonSkin = new AdvAlertButtonSkin();
myButtonSkin.bgRect = new SolidColorRect(0xffffff, [0,0,0,0], 1);
myButtonSkin.bgStroke = new SolidColorStroke(0, 0, 0);
myButtonSkin.textFormat.bold = true;
myButtonSkin.textFormat.color = 0x000000;
myButtonSkin.hover_bgRect = new SolidColorRect(0x000000, [0,0,0,0], 1);
myButtonSkin.hover_bgStroke = new SolidColorStroke(0, 0, 0);
myButtonSkin.hover_textFormat.bold = true;
myButtonSkin.hover_textFormat.color = 0xf;


AlertManager = new AdvAlertManager(this, stage, mySkin, myButtonSkin, null, true, 400);
var myAlert:AdvAlertWindow = AlertManager.alert("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "Title", [new AdvAlertButton("OK"), new AdvAlertButton("Cancel")]);



var mySkin:AdvAlertSkin = new AdvAlertSkin();
var bgData:BitmapData = new BitmapData(400, 200, false, 0xffffffff);
bgData.perlinNoise(100, 100, 4, 218, true, true, 1, false);
mySkin.bgRect = new BitmapRect(bgData, null, true, false, [10, 10, 10, 10]);
mySkin.bgStroke = new SolidColorStroke(3, 0x440000, 1);
mySkin.headerRect = new SolidColorRect(0x000000, [10, 10, 10, 10], 0.5);
mySkin.headerHeight = 40;
mySkin.titleFormat.size = 30;
mySkin.titleFormat.align = "center";
mySkin.buttonbarAlign = "center";
mySkin.blurColor = 0x0;

var myButtonSkin:AdvAlertButtonSkin = new AdvAlertButtonSkin();
myButtonSkin.bgRect = new SolidColorRect(0x000000, [10, 10, 10, 10], 0.5);
myButtonSkin.bgStroke = new SolidColorStroke (1, 0x000000, 0);
myButtonSkin.w = 100;
myButtonSkin.hover_bgRect = new SolidColorRect(0xff0000, [10, 10, 10, 10], 0.5);
myButtonSkin.hover_bgStroke = new SolidColorStroke (1, 0x000000, 0);
myButtonSkin.hover_w = 100;

AlertManager = new AdvAlertManager(this, stage, mySkin, myButtonSkin, null, true, 400);
var myAlert:AdvAlertWindow = AlertManager.alert("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "Title", [new AdvAlertButton("OK"), new AdvAlertButton("Cancel")]);



var mySkin:AdvAlertSkin = new AdvAlertSkin();
mySkin.bgRect = new SolidColorRect(0xffffff, [0,0,0,0], 1);
mySkin.bgStroke = new SolidColorStroke(2, 0x000000, 1);
mySkin.headerRect = new SolidColorRect(0xaaffaa, [0, 0, 0, 0], 1);
mySkin.headerStroke = new SolidColorStroke(1, 0x555555, 1);
mySkin.textFormat.size = 13;
mySkin.titleFormat.size = 20;
mySkin.textFormat.color = 0x111111;
mySkin.titleFormat.color = 0x333333;
mySkin.titleFilters = [new DropShadowFilter(3, 45, 0xffffff, 1, 0, 0)];
mySkin.titleFormat.align = "center";
mySkin.filters = [new DropShadowFilter(8, 45, 0, 1, 0, 0)];

var myButtonSkin:AdvAlertButtonSkin = new AdvAlertButtonSkin();
myButtonSkin.bgRect = new SolidColorRect(0xaaffaa, [0, 0, 0, 0], 1);
myButtonSkin.bgStroke = new SolidColorStroke(1, 0x555555, 1);
myButtonSkin.w = 110;
myButtonSkin.textFormat.color = 0x000000;
myButtonSkin.textFilters = [new DropShadowFilter(3, 45, 0xffffff, 1, 0, 0)];
myButtonSkin.hover_bgRect = new SolidColorRect(0xffffff, [0, 0, 0, 0], 1);
myButtonSkin.hover_bgStroke = new SolidColorStroke(1, 0x555555, 1);
myButtonSkin.hover_w = 110;
myButtonSkin.hover_textFormat.color = 0x000000;
myButtonSkin.hover_textFilters = [new DropShadowFilter(3, 45, 0xffffff, 1, 0, 0)];

AlertManager = new AdvAlertManager(this, stage, mySkin, myButtonSkin, null, true, 400);
var myAlert:AdvAlertWindow = AlertManager.alert("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "Title", [new AdvAlertButton("OK"), new AdvAlertButton("Cancel")]);

Now you see what can be achieved with just a few lines of code and AdvAlert!

If you make any cool skins yourself and want to share them with others, post the code in the comments below!

Thanks for reading!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.