Fix cameras on difficulty creation

This commit is contained in:
lunarcleint
2024-02-02 16:03:33 -07:00
parent 5d3671c5e6
commit 3eb2c0df51
6 changed files with 38 additions and 3 deletions
+3 -3
View File
@@ -1,3 +1,3 @@
function update(elapsed)
if (FlxG.keys.justPressed.F5)
FlxG.resetState();
//
function update(elapsed:Float)
if (FlxG.keys.justPressed.F5) FlxG.resetState();
+17
View File
@@ -0,0 +1,17 @@
#pragma header
// Used in difficulty screen
uniform vec4 clipRect;
bool boxCollision(vec2 pixel, vec4 rect) {
return (pixel.x >= rect.x) && (pixel.x < rect.x + rect.z) && (pixel.y >= rect.y) && (pixel.y < rect.y + rect.w);
}
void main()
{
vec2 pixel = gl_FragCoord.xy;
if (boxCollision(pixel, clipRect)) gl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv.xy);
else gl_FragColor = vec4(0.);
}
+2
View File
@@ -1,5 +1,7 @@
#pragma header
// Used in colorwheel
vec3 hsvToRgb(vec3 c) { //hsv.x = hue, hsv.y = saturation, hsv.z = value
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
+2
View File
@@ -1,6 +1,8 @@
#pragma header
#define PI 3.14159265359
// Used for editors
int steps = 16;
int stepsInside = 2;
float strength = 0.0075;
@@ -1,5 +1,7 @@
#pragma header
// Used for editors (faster)
//#define iResolution _camSize
#define getTexture textureCam