Error handling for frame buffer

This commit is contained in:
EliteMasterEric 2024-02-12 16:49:25 -05:00
parent a0df87c6b2
commit ce0860fc18
1 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,11 @@ class FrameBufferManager
*/
public function copySpriteTo(name:String, sprite:FlxSprite, color:Null<FlxColor> = null):Void
{
if (!frameBufferMap.exists(name))
{
FlxG.log.warn('frame buffer "$name" does not exist');
return;
}
frameBufferMap[name].addSpriteCopy(new SpriteCopy(sprite, color));
}
@ -63,6 +68,11 @@ class FrameBufferManager
*/
public function moveSpriteTo(name:String, sprite:FlxSprite):Void
{
if (!frameBufferMap.exists(name))
{
FlxG.log.warn('frame buffer "$name" does not exist');
return;
}
frameBufferMap[name].moveSprite(sprite);
}