@@ -0,0 +1,1789 @@
+package com.haxademic.demo.draw.mapping;%0A%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.constants.AppSettings;%0Aimport com.haxademic.core.draw.color.Gradients;%0Aimport com.haxademic.core.draw.context.DrawUtil;%0Aimport com.haxademic.core.draw.image.ImageUtil;%0Aimport com.haxademic.core.file.DemoAssets;%0A%0Aimport processing.core.PGraphics;%0A%0Apublic class Demo_GradientEdge %0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%0A%09protected PGraphics fadeEdge;%0A%0A%09protected void overridePropsFile() %7B%0A%09%09p.appConfig.setProperty( AppSettings.WIDTH, 800 );%0A%09%09p.appConfig.setProperty( AppSettings.HEIGHT, 800 );%0A%09%7D%0A%0A%09protected void setupFirstFrame() %7B%0A%09%09float fadeSize = 0.1f;%0A%09%09float solidSize = 1f - fadeSize;%0A%09%09%0A%09%09fadeEdge = p.createGraphics(1024, 1024, P.P3D);%0A%09%09fadeEdge.beginDraw();%0A%09%09DrawUtil.setDrawCenter(fadeEdge);%0A%09%09// draw gradient%0A%09%09fadeEdge.translate(fadeEdge.width * (fadeSize * 0.5f), fadeEdge.height / 2);%0A%09%09fadeEdge.noStroke();%0A%09%09Gradients.linear(fadeEdge, fadeEdge.width * fadeSize, fadeEdge.height, p.color(1, 0), p.color(0,255));%0A%09%09// draw solid portion%0A%09%09fadeEdge.translate(fadeEdge.width * (solidSize * 0.5f + fadeSize * 0.5f), 0);%0A%09%09fadeEdge.fill(0);%0A%09%09fadeEdge.rect(0, 0, fadeEdge.width * solidSize, fadeEdge.height);%0A%09%09fadeEdge.endDraw();%0A%09%7D%0A%0A%09public void drawApp() %7B%0A%09%09ImageUtil.cropFillCopyImage(DemoAssets.justin(), p.g, true);%0A%09%09DrawUtil.setCenterScreen(p);%0A%09%09DrawUtil.setDrawCenter(p);%0A%09%09%0A%09%09// draw%0A%09%09p.rotate(P.map(p.mousePercentY(), 0, 1, P.PI, -P.PI));%0A%09%09p.image(fadeEdge, 0, 0, %0A%09%09%09%09fadeEdge.width * (0.5f + 0.2f * P.sin(p.frameCount * 0.01f)),%0A%09%09%09%09fadeEdge.height * (0.5f + 0.2f * P.sin(p.frameCount * 0.015f))%0A%09%09%09%09);%0A%09%7D%0A%09%09%0A%7D

Add gradient edge demo for projection mapping utility