Skip to content

Commit c50bf45

Browse files
Add offset var to note in NoteStyle.hx
Co-authored-by: NebulaStellaNova <[email protected]>
1 parent 80993df commit c50bf45

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/funkin/play/notes/notestyle/NoteStyle.hx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class NoteStyle implements IRegistryEntry<NoteStyleData>
8686

8787
target.antialiasing = !(_data.assets?.note?.isPixel ?? false);
8888

89+
var noteOffsets:Array<Float> = getNoteOffsets();
90+
target.offset.set(noteOffsets[0], noteOffsets[1]);
91+
8992
// Apply the animations.
9093
buildNoteAnimations(target);
9194

@@ -180,6 +183,11 @@ class NoteStyle implements IRegistryEntry<NoteStyleData>
180183
return _data.assets?.note?.scale ?? fallback?.getNoteScale() ?? 1.0;
181184
}
182185

186+
public function getNoteOffsets():Array<Float>
187+
{
188+
return _data?.assets?.note?.offsets ?? fallback?.getNoteOffsets() ?? [0.0, 0.0];
189+
}
190+
183191
function fetchNoteAnimationData(dir:NoteDirection):Null<AnimationData>
184192
{
185193
var result:Null<AnimationData> = switch (dir)

0 commit comments

Comments
 (0)