Skip to content

Commit

Permalink
pointer fix
Browse files Browse the repository at this point in the history
Co-authored-by: rich <87835336+richTrash21@users.noreply.github.com>
  • Loading branch information
charlesisfeline and richTrash21 authored May 22, 2024
1 parent 7669470 commit 871ef90
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions source/states/editors/CharacterEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import flixel.FlxObject;
import flixel.graphics.FlxGraphic;

import flixel.animation.FlxAnimation;
import flixel.system.debug.interaction.tools.Pointer.GraphicCursorCross;
import flixel.addons.ui.*;
import flixel.ui.FlxButton;
import flixel.util.FlxDestroyUtil;
Expand All @@ -19,6 +18,14 @@ import objects.Character;
import objects.HealthIcon;
import objects.Bar;

// flixel 5.7.0+ fix
#if (FLX_DEBUG || flixel < version("5.7.0"))
typedef PointerGraphic = flixel.system.debug.interaction.tools.Pointer.GraphicCursorCross;
#else
@:bitmap("assets/images/debugger/cursorCross.png")
class PointerGraphic extends openfl.display.BitmapData {}
#end

class CharacterEditorState extends MusicBeatState
{
var character:Character;
Expand Down Expand Up @@ -103,7 +110,7 @@ class CharacterEditorState extends MusicBeatState

addCharacter();

cameraFollowPointer = new FlxSprite().loadGraphic(FlxGraphic.fromClass(GraphicCursorCross));
cameraFollowPointer = new FlxSprite(FlxGraphic.fromClass(PointerGraphic));
cameraFollowPointer.setGraphicSize(40, 40);
cameraFollowPointer.updateHitbox();
add(cameraFollowPointer);
Expand Down Expand Up @@ -1316,4 +1323,4 @@ class CharacterEditorState extends MusicBeatState
_file.save(data, '$_char.json');
}
}
}
}

0 comments on commit 871ef90

Please sign in to comment.