Skip to content

Commit 1213c79

Browse files
committed
fix #109
1 parent fce8f96 commit 1213c79

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

source/states/editors/CharacterEditorState.hx

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package states.editors;
22

3+
import openfl.display.BitmapData;
34
import online.states.SkinsState;
45
import flixel.FlxObject;
56
import flixel.graphics.FlxGraphic;
67
import flixel.animation.FlxAnimation;
78
import flixel.graphics.frames.FlxAtlasFrames;
8-
import flixel.system.debug.interaction.tools.Pointer.GraphicCursorCross;
99
import flixel.addons.ui.FlxUI;
1010
import flixel.addons.ui.FlxUICheckBox;
1111
import flixel.addons.ui.FlxUIInputText;
@@ -25,6 +25,9 @@ import objects.HealthBar;
2525
import sys.FileSystem;
2626
#end
2727

28+
@:bitmap("assets/images/debugger/cursorCross.png")
29+
class FlixelGraphicCursorCross extends BitmapData {}
30+
2831
class CharacterEditorState extends MusicBeatState {
2932
var char:Character;
3033
var ghostChar:Character;
@@ -110,11 +113,11 @@ class CharacterEditorState extends MusicBeatState {
110113
charLayer = new FlxTypedGroup<Character>();
111114
add(charLayer);
112115

113-
var pointer:FlxGraphic = FlxGraphic.fromClass(GraphicCursorCross);
116+
var pointer:FlxGraphic = FlxGraphic.fromClass(FlixelGraphicCursorCross);
114117
cameraFollowPointer = new FlxSprite().loadGraphic(pointer);
115-
cameraFollowPointer.setGraphicSize(40, 40);
116-
cameraFollowPointer.updateHitbox();
118+
updateCamPointerZoom();
117119
cameraFollowPointer.color = FlxColor.WHITE;
120+
cameraFollowPointer.antialiasing = false; //global antialiasing is set by psych online to true
118121
add(cameraFollowPointer);
119122

120123
changeBGbutton = new FlxButton(FlxG.width - 360, 25, "", function() {
@@ -1026,8 +1029,8 @@ class CharacterEditorState extends MusicBeatState {
10261029
}
10271030
y -= 100 - char.cameraPosition[1];
10281031

1029-
x -= cameraFollowPointer.width / 2;
1030-
y -= cameraFollowPointer.height / 2;
1032+
// x -= cameraFollowPointer.width / 2;
1033+
// y -= cameraFollowPointer.height / 2;
10311034
cameraFollowPointer.setPosition(x, y);
10321035
}
10331036

@@ -1233,17 +1236,20 @@ class CharacterEditorState extends MusicBeatState {
12331236

12341237
if (FlxG.keys.justPressed.R) {
12351238
FlxG.camera.zoom = 1;
1239+
updateCamPointerZoom();
12361240
}
12371241

12381242
if (FlxG.keys.pressed.E && FlxG.camera.zoom < 3) {
12391243
FlxG.camera.zoom += elapsed * FlxG.camera.zoom;
12401244
if (FlxG.camera.zoom > 3)
12411245
FlxG.camera.zoom = 3;
1246+
updateCamPointerZoom();
12421247
}
12431248
if (FlxG.keys.pressed.Q && FlxG.camera.zoom > 0.1) {
12441249
FlxG.camera.zoom -= elapsed * FlxG.camera.zoom;
12451250
if (FlxG.camera.zoom < 0.1)
12461251
FlxG.camera.zoom = 0.1;
1252+
updateCamPointerZoom();
12471253
}
12481254

12491255
if (FlxG.keys.pressed.I || FlxG.keys.pressed.J || FlxG.keys.pressed.K || FlxG.keys.pressed.L) {
@@ -1332,6 +1338,12 @@ class CharacterEditorState extends MusicBeatState {
13321338
super.update(elapsed);
13331339
}
13341340

1341+
function updateCamPointerZoom() {
1342+
cameraFollowPointer.setGraphicSize(40 / FlxG.camera.zoom, 40 / FlxG.camera.zoom);
1343+
cameraFollowPointer.updateHitbox();
1344+
cameraFollowPointer.offset.set(cameraFollowPointer.frameWidth / 2, cameraFollowPointer.frameHeight / 2);
1345+
}
1346+
13351347
var _file:FileReference;
13361348

13371349
/*private function saveOffsets()

0 commit comments

Comments
 (0)