Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,16 +258,21 @@ class FlxSprite extends FlxObject | |
colorTransform = null; | ||
blend = null; | ||
|
||
destroyInnerFrameGraphic(); | ||
|
||
frames = null; | ||
graphic = null; | ||
_frame = FlxDestroyUtil.destroy(_frame); | ||
} | ||
|
||
private inline function destroyInnerFrameGraphic():Void | ||
{ | ||
#if FLX_RENDER_TILE | ||
if (_frame != null && frame != null && frame.parent != _frame.parent) | ||
{ | ||
_frame.parent.destroy(); | ||
} | ||
#end | ||
|
||
frames = null; | ||
graphic = null; | ||
_frame = FlxDestroyUtil.destroy(_frame); | ||
} | ||
|
||
public function clone():FlxSprite | ||
|
@@ -506,6 +511,15 @@ class FlxSprite extends FlxObject | |
height = frameHeight; | ||
} | ||
|
||
/** | ||
* Helper method just for convinience, so you don't need to type: | ||
* sprite.frame = sprite.frame; | ||
*/ | ||
public inline function resetFrame():Void | ||
{ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Beeblerox
Author
Member
|
||
frame = this.frame; | ||
} | ||
|
||
/** | ||
* Helper function to set the graphic's dimensions by using scale, allowing you to keep the current aspect ratio | ||
* should one of the Integers be <= 0. It might make sense to call updateHitbox() afterwards! | ||
|
@@ -926,11 +940,7 @@ class FlxSprite extends FlxObject | |
|
||
// recreate _frame for native target, so it will use modified framePixels | ||
#if FLX_RENDER_TILE | ||
if (frame.parent != _frame.parent) | ||
{ | ||
_frame.parent.destroy(); | ||
} | ||
|
||
destroyInnerFrameGraphic(); | ||
var graph:FlxGraphic = FlxGraphic.fromBitmapData(framePixels, false, null, false); | ||
_frame = graph.imageFrame.frame.copyTo(_frame); | ||
#end | ||
|
6 comments
on commit 81c3dd0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect #1593 at all? I'm not really sure what tile render mode is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MSGhero no, it doesn't affect this issue at all. As you may know i've started work on it earlier, but haven't finished it. I will write down my thoughts on it next week on slack (i want to break some existing behavior, like origin handling).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is the right place but only want to say that FlxGlitchSprite seems to stop working properly after last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xbelanch probably i know what's the problem. I'll try to fix it tonight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xbelanch it should be fixed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Beeblerox Thanks! it works like a charm
What does this do exactly?