Compare commits

...

5 commits

Author SHA1 Message Date
Abnormal
248b8e6d39
Merge 2a370ca94d into 0d8e4a5330 2024-10-30 16:50:15 +00:00
Abnormal
2a370ca94d fix inconsistency 2024-10-18 08:21:55 -05:00
Abnormal
cdbce5f0bf cleanup 2024-10-07 20:34:33 -05:00
Abnormal
da37cb3f65 cleanup 2024-10-07 20:24:11 -05:00
Abnormal
b8ae1994fc add album title offsets 2024-10-07 20:22:33 -05:00
3 changed files with 25 additions and 2 deletions

View file

@ -36,6 +36,13 @@ typedef AlbumData =
*/
public var albumTitleAsset:String;
/**
* Offsets for the album title.
*/
@:optional
@:default([0, 0])
public var albumTitleOffsets:Null<Array<Float>>;
/**
* An optional array of animations for the album title.
*/

View file

@ -76,6 +76,14 @@ class Album implements IRegistryEntry<AlbumData>
return _data.albumTitleAsset;
}
/**
* Get the offsets for the album title.
*/
public function getAlbumTitleOffsets():Null<Array<Float>>
{
return _data.albumTitleOffsets;
}
public function hasAlbumTitleAnimations()
{
return _data.albumTitleAnimations.length > 0;

View file

@ -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<Array<Float>>):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,