浏览代码

fixed samples

ncannasse 7 年之前
父节点
当前提交
7517fa13e0
共有 2 个文件被更改,包括 2 次插入22 次删除
  1. 1 21
      samples/Mask.hx
  2. 1 1
      samples/Shadows.hx

+ 1 - 21
samples/Mask.hx

@@ -17,31 +17,11 @@ class Mask extends hxd.App {
 			b.x = Std.random(200) - 100;
 			b.y = Std.random(200) - 100;
 		}
-
-		engine.backgroundColor = 0x200000;
-		cache = new h2d.CachedBitmap(s2d, 160, 160);
-		cache.blendMode = None;
-		cache.x = 400;
-		cache.y = 150;
-		cache.colorMatrix = h3d.Matrix.I();
-		spr2 = new h2d.Sprite(cache);
-		spr2.x = spr2.y = 80;
-		for( i in 0...10 ) {
-			var b = new h2d.Bitmap(hxd.Res.hxlogo.toTile(), spr2);
-			b.scale(0.4);
-			b.x = Std.random(200) - 100;
-			b.y = Std.random(200) - 100;
-		}
 	}
 
 	override function update(dt:Float) {
-		spr.rotation += 0.01 * dt;
-		spr2.rotation += 0.01 * dt;
 		time += dt/60;
-		cache.freezed = (time % 2.) > 1;
-		cache.colorMatrix.identity();
-		cache.colorMatrix.colorHue(time);
-		cache.colorMatrix.colorSaturation(cache.freezed ? -1 : 0);
+		spr.rotation += 0.01 * dt;
 	}
 
 	static function main() {

+ 1 - 1
samples/Shadows.hx

@@ -45,7 +45,7 @@ class Shadows extends hxd.App {
 
 	override function update( dt : Float ) {
 		time += dt * 0.01;
-		dir.direction.set(Math.cos(time), Math.sin(time) * 2, -1);
+		dir.setDirection(new h3d.Vector(Math.cos(time), Math.sin(time) * 2, -1));
 	}
 
 	static function main() {