package com.haxademic.app.haxmapper.textures;

import com.haxademic.core.app.P;
import com.haxademic.core.draw.util.DrawUtil;
import com.haxademic.core.math.MathUtil;

public class TextureTwistingSquares
extends BaseTexture {
	
	public TextureTwistingSquares( int width, int height ) {
		super();

		buildGraphics( width, height );
		updateTimingSection();
	}
	
	public void updateDraw() {
//		_texture.clear();

		DrawUtil.setDrawCenter(_texture);
		_texture.translate( _texture.width/2, _texture.height/2, 0 );

		_texture.background(0);
		
		int steps = 50;
		float oscInc = P.TWO_PI / (float)steps;
		float lineSize = 25f + 1f * P.sin( ( P.p.frameCount ) * oscInc );
		
		for( int i=100; i > 0; i-- ) {
			
			float rot = P.sin( ( P.p.frameCount + i ) * oscInc );
			
			if( i % 2 == 0 ) {
				_texture.fill( 0 );
				_texture.stroke( 0 );
			} else {
				_texture.fill( _colorEase.colorInt() );
				_texture.stroke( _colorEase.colorInt() );
			}
			
			_texture.pushMatrix();
			_texture.rotate( rot * 0.4f );
			_texture.rect( 0, 0, i * lineSize, i * lineSize );
			_texture.popMatrix();
		}
	}
	
	public void updateTimingSection() {
	}

}

@@ -159,16 +159,67 @@
 athUtil;
+%0Aimport com.haxademic.core.math.easing.EasingFloat;
 %0A%0Apublic
@@ -272,16 +272,75 @@
 ure %7B%0A%09%0A
+%09protected EasingFloat _steps = new EasingFloat(50f, 6);%0A%09%0A
 %09public 
@@ -510,24 +510,43 @@
 ure.clear();
+%0A%09%09_steps.update();
 %0A%0A%09%09DrawUtil
@@ -667,18 +667,20 @@
 );%0A%09%09%0A%09%09
-in
+floa
 t steps 
@@ -681,18 +681,30 @@
 steps = 
-50
+_steps.value()
 ;%0A%09%09floa
@@ -729,15 +729,8 @@
 I / 
-(float)
 step
@@ -755,11 +755,17 @@
 e = 
-25f
+(steps/2)
  + 1
@@ -1234,24 +1234,24 @@
 );%0A%09%09%7D%0A%09%7D%0A%09%0A
-
 %09public void
@@ -1275,14 +1275,69 @@
 ion() %7B%0A
+%09%09_steps.setTarget(MathUtil.randRangeDecimal(10, 60));%0A
 %09%7D%0A%0A%7D%0A

Add some extra draw options