diff --git a/source/funkin/data/freeplay/album/AlbumData.hx b/source/funkin/data/freeplay/album/AlbumData.hx index 9dea443b1..2a74561cb 100644 --- a/source/funkin/data/freeplay/album/AlbumData.hx +++ b/source/funkin/data/freeplay/album/AlbumData.hx @@ -36,6 +36,13 @@ typedef AlbumData = */ public var albumTitleAsset:String; + /** + * Offsets for the album title. + */ + @:optional + @:default([0, 0]) + public var albumTitleOffsets:Null>; + /** * An optional array of animations for the album title. */ diff --git a/source/funkin/ui/freeplay/Album.hx b/source/funkin/ui/freeplay/Album.hx index 9bae88de0..154013ea3 100644 --- a/source/funkin/ui/freeplay/Album.hx +++ b/source/funkin/ui/freeplay/Album.hx @@ -76,6 +76,14 @@ class Album implements IRegistryEntry return _data.albumTitleAsset; } + /** + * Get the offsets for the album title. + */ + public function getAlbumTitleOffsets():Null> + { + return _data.albumTitleOffsets; + } + public function hasAlbumTitleAnimations() { return _data.albumTitleAnimations.length > 0; diff --git a/source/funkin/ui/freeplay/AlbumRoll.hx b/source/funkin/ui/freeplay/AlbumRoll.hx index 81a9fe858..7d26dae2f 100644 --- a/source/funkin/ui/freeplay/AlbumRoll.hx +++ b/source/funkin/ui/freeplay/AlbumRoll.hx @@ -112,7 +112,7 @@ class AlbumRoll extends FlxSpriteGroup var albumGraphic = Paths.image(albumData.getAlbumArtAssetKey()); newAlbumArt.replaceFrameGraphic(0, albumGraphic); - buildAlbumTitle(albumData.getAlbumTitleAssetKey()); + buildAlbumTitle(albumData.getAlbumTitleAssetKey(), albumData.getAlbumTitleOffsets()); applyExitMovers(); @@ -198,7 +198,7 @@ class AlbumRoll extends FlxSpriteGroup albumTitle.visible = true; } - public function buildAlbumTitle(assetKey:String):Void + public function buildAlbumTitle(assetKey:String, ?titleOffsets:Null>):Void { if (albumTitle != null) { @@ -206,6 +206,11 @@ class AlbumRoll extends FlxSpriteGroup albumTitle = null; } + if (titleOffsets == null) + { + titleOffsets = [0, 0]; + } + albumTitle = FunkinSprite.createSparrow(925, 500, assetKey); albumTitle.visible = albumTitle.frames != null && newAlbumArt.visible; albumTitle.animation.addByPrefix('idle', 'idle0', 24, true); @@ -219,6 +224,9 @@ class AlbumRoll extends FlxSpriteGroup albumTitle.zIndex = 1000; + albumTitle.x += titleOffsets[0]; + albumTitle.y += titleOffsets[1]; + if (_exitMovers != null) _exitMovers.set([albumTitle], { x: FlxG.width,