|
@@ -5,10 +5,9 @@ class Main extends hxd.App {
|
|
var spr : h2d.Sprite;
|
|
var spr : h2d.Sprite;
|
|
|
|
|
|
override function init() {
|
|
override function init() {
|
|
- engine.debug = true;
|
|
|
|
- var scale = 1;
|
|
|
|
|
|
+ engine.backgroundColor = 0x002000;
|
|
|
|
+ var scale = 4;
|
|
spr = new h2d.Sprite(s2d);
|
|
spr = new h2d.Sprite(s2d);
|
|
- spr.filters = [new h2d.filter.Blur(2,100,3)];
|
|
|
|
spr.x = s2d.width * 0.5;
|
|
spr.x = s2d.width * 0.5;
|
|
spr.y = s2d.height * 0.5;
|
|
spr.y = s2d.height * 0.5;
|
|
spr.scale(scale);
|
|
spr.scale(scale);
|
|
@@ -17,10 +16,28 @@ class Main extends hxd.App {
|
|
bmp.colorKey = 0xFFFFFF;
|
|
bmp.colorKey = 0xFFFFFF;
|
|
bmp.x = -bmp.tile.width * 0.5 * bmp.scaleX;
|
|
bmp.x = -bmp.tile.width * 0.5 * bmp.scaleX;
|
|
bmp.y = -bmp.tile.height * 0.5 * bmp.scaleY;
|
|
bmp.y = -bmp.tile.height * 0.5 * bmp.scaleY;
|
|
|
|
+
|
|
|
|
+ setFilters(2);
|
|
|
|
+
|
|
|
|
+ var help = new h2d.Text(hxd.Res.customFont.toFont(), s2d);
|
|
|
|
+ help.x = help.y = 5;
|
|
|
|
+ help.text = "1:Blur 2:Glow";
|
|
}
|
|
}
|
|
|
|
|
|
override function update(dt:Float) {
|
|
override function update(dt:Float) {
|
|
spr.rotation += 0.01 * dt;
|
|
spr.rotation += 0.01 * dt;
|
|
|
|
+ for( i in 1...3 )
|
|
|
|
+ if( K.isPressed(K.NUMBER_0 + i) )
|
|
|
|
+ setFilters(i);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function setFilters(i) {
|
|
|
|
+ switch( i ) {
|
|
|
|
+ case 1:
|
|
|
|
+ spr.filters = [new h2d.filter.Blur(2, 100, 3)];
|
|
|
|
+ case 2:
|
|
|
|
+ spr.filters = [new h2d.filter.Glow(0xFF00FF, 100, 1)];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static function main() {
|
|
static function main() {
|