fixed upside down tankmens
Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>
This commit is contained in:
@@ -211,10 +211,9 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
|
||||
r.x -= camera.width / 2;
|
||||
r.y -= camera.height / 2;
|
||||
|
||||
var ratio = FlxMath.lerp(1 / camera.zoom, 1, zoomFactor);
|
||||
var ratio = (camera.zoom > 0 ? Math.max : Math.min)(0, FlxMath.lerp(1 / camera.zoom, 1, zoomFactor));
|
||||
r.x *= ratio;
|
||||
r.y *= ratio;
|
||||
|
||||
r.width *= ratio;
|
||||
r.height *= ratio;
|
||||
|
||||
@@ -224,24 +223,34 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
|
||||
return r;
|
||||
}
|
||||
|
||||
override public function isOnScreen(?camera:FlxCamera):Bool
|
||||
{
|
||||
if (forceIsOnScreen)
|
||||
return true;
|
||||
|
||||
if (camera == null)
|
||||
camera = FlxG.camera;
|
||||
|
||||
var bounds = getScreenBounds(_rect, camera);
|
||||
if (bounds.width == 0 && bounds.height == 0)
|
||||
return false;
|
||||
return camera.containsRect(bounds);
|
||||
}
|
||||
|
||||
// ZOOM FACTOR RENDERING
|
||||
public override function doAdditionalMatrixStuff(matrix:FlxMatrix, camera:FlxCamera)
|
||||
{
|
||||
super.doAdditionalMatrixStuff(matrix, camera);
|
||||
if(__shouldDoZoomFactor()) {
|
||||
matrix.translate(-camera.width / 2, -camera.height / 2);
|
||||
|
||||
var requestedZoom = FlxMath.lerp(1, camera.zoom, zoomFactor);
|
||||
var requestedZoom = (camera.zoom >= 0 ? Math.max : Math.min)(FlxMath.lerp(1, camera.zoom, zoomFactor), 0);
|
||||
var diff = requestedZoom / camera.zoom;
|
||||
matrix.scale(diff, diff);
|
||||
matrix.translate(camera.width / 2, camera.height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
public override function getScreenPosition(?point:FlxPoint, ?Camera:FlxCamera):FlxPoint
|
||||
{
|
||||
return super.getScreenPosition(point, Camera);
|
||||
}
|
||||
|
||||
// OFFSETTING
|
||||
#if REGION
|
||||
public var animOffsets:Map<String, FlxPoint> = new Map<String, FlxPoint>();
|
||||
|
||||
@@ -567,13 +567,13 @@ class StageEditor extends UIState {
|
||||
}
|
||||
}*/
|
||||
for(sprite in stage.stageSprites) {
|
||||
if(sprite.visible) {
|
||||
if(sprite.visible && sprite.isOnScreen()) {
|
||||
@:privateAccess if(sprite._frame == null) continue;
|
||||
drawGuides(sprite);
|
||||
}
|
||||
}
|
||||
for(char in chars) {
|
||||
if(char.visible) {
|
||||
if(char.visible && char.isOnScreen()) {
|
||||
@:privateAccess if(char._frame == null) continue;
|
||||
drawGuides(char);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user