This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quality of life shit to add swag stuff later
- Loading branch information
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package funkin.graphics; | ||
|
||
enum RenderMode { | ||
QUAD; | ||
REPEAT; | ||
} | ||
|
||
class SmartSprite extends FlxRepeatSprite { | ||
public var renderMode:RenderMode = QUAD; | ||
|
||
public function new(?X:Float, ?Y:Float, ?SimpleGraphic:FlxGraphicAsset) { | ||
super(X, Y, SimpleGraphic, 0, 0); | ||
} | ||
|
||
override function drawComplex(camera:FlxCamera) { | ||
switch (renderMode) { | ||
case REPEAT: super.drawComplex(camera); | ||
case QUAD: | ||
_frame.prepareMatrix(_matrix, ANGLE_0, checkFlipX(), checkFlipY()); | ||
_matrix.translate(-origin.x, -origin.y); | ||
_matrix.scale(scale.x, scale.y); | ||
|
||
if (matrixExposed) _matrix.concat(transformMatrix); | ||
else { | ||
if (bakedRotationAngle <= 0) { | ||
updateTrig(); | ||
if (angle != 0) _matrix.rotateWithTrig(_cosAngle, _sinAngle); | ||
} | ||
updateSkewMatrix(); | ||
_matrix.concat(_skewMatrix); | ||
} | ||
|
||
getScreenPosition(_point, camera).subtractPoint(offset); | ||
_point.addPoint(origin); | ||
_matrix.translate(_point.x, _point.y); | ||
camera.drawPixels(_frame, framePixels, _matrix, colorTransform, blend, antialiasing, shader); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters