mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-14 19:25:16 -05:00
updating more stuff
This commit is contained in:
parent
be4ca0f47d
commit
28068b1a86
3 changed files with 71 additions and 1 deletions
23
source/funkin/graphics/shaders/MosaicEffect.hx
Normal file
23
source/funkin/graphics/shaders/MosaicEffect.hx
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package funkin.graphics.shaders;
|
||||||
|
|
||||||
|
import flixel.addons.display.FlxRuntimeShader;
|
||||||
|
import openfl.utils.Assets;
|
||||||
|
import funkin.Paths;
|
||||||
|
import flixel.math.FlxPoint;
|
||||||
|
|
||||||
|
class MosaicEffect extends FlxRuntimeShader
|
||||||
|
{
|
||||||
|
public var blockSize:FlxPoint = FlxPoint.get(1.0, 1.0);
|
||||||
|
|
||||||
|
public function new()
|
||||||
|
{
|
||||||
|
super(Assets.getText(Paths.frag('mosaic')));
|
||||||
|
setBlockSize(1.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBlockSize(w:Float, h:Float)
|
||||||
|
{
|
||||||
|
blockSize.set(w, h);
|
||||||
|
setFloatArray("uBlocksize", [w, h]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,7 +9,6 @@ import openfl.display.BlendMode;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.group.FlxSpriteGroup;
|
import flixel.group.FlxSpriteGroup;
|
||||||
import funkin.play.stage.Stage;
|
import funkin.play.stage.Stage;
|
||||||
import funkin.play.stage.StageData.StageDataParser;
|
|
||||||
import funkin.modding.events.ScriptEvent;
|
import funkin.modding.events.ScriptEvent;
|
||||||
import funkin.modding.events.ScriptEventDispatcher;
|
import funkin.modding.events.ScriptEventDispatcher;
|
||||||
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
||||||
|
|
48
source/funkin/util/FramesJSFLParser.hx
Normal file
48
source/funkin/util/FramesJSFLParser.hx
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
package funkin.util;
|
||||||
|
|
||||||
|
import openfl.Assets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See `funScripts/jsfl/frames.jsfl` for more information in the art repo/folder!
|
||||||
|
* Homemade dipshit proprietary format to get simple animation info out of flash!
|
||||||
|
* Pure convienience!
|
||||||
|
*/
|
||||||
|
class FramesJSFLParser
|
||||||
|
{
|
||||||
|
public static function parse(path:String):FramesJSFLInfo
|
||||||
|
{
|
||||||
|
var text:String = Assets.getText(path);
|
||||||
|
|
||||||
|
// TODO: error handle if text is null
|
||||||
|
|
||||||
|
var output:FramesJSFLInfo = {frames: []};
|
||||||
|
|
||||||
|
var frames:Array<String> = text.split("\n");
|
||||||
|
|
||||||
|
for (frame in frames)
|
||||||
|
{
|
||||||
|
var frameInfo:Array<String> = frame.split(" ");
|
||||||
|
|
||||||
|
var x:Float = Std.parseFloat(frameInfo[0]);
|
||||||
|
var y:Float = Std.parseFloat(frameInfo[1]);
|
||||||
|
var alpha:Float = Std.parseFloat(frameInfo[2]);
|
||||||
|
|
||||||
|
var shit:FramesJSFLFrame = {x: x, y: y, alpha: alpha};
|
||||||
|
output.frames.push(shit);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef FramesJSFLInfo =
|
||||||
|
{
|
||||||
|
var frames:Array<FramesJSFLFrame>;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef FramesJSFLFrame =
|
||||||
|
{
|
||||||
|
var x:Float;
|
||||||
|
var y:Float;
|
||||||
|
var alpha:Float;
|
||||||
|
}
|
Loading…
Reference in a new issue