mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-28 02:25:51 -05:00
Compare commits
5 commits
517fc4b649
...
248b8e6d39
Author | SHA1 | Date | |
---|---|---|---|
|
248b8e6d39 | ||
|
2a370ca94d | ||
|
cdbce5f0bf | ||
|
da37cb3f65 | ||
|
b8ae1994fc |
3 changed files with 25 additions and 2 deletions
|
@ -36,6 +36,13 @@ typedef AlbumData =
|
||||||
*/
|
*/
|
||||||
public var albumTitleAsset:String;
|
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.
|
* An optional array of animations for the album title.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,6 +76,14 @@ class Album implements IRegistryEntry<AlbumData>
|
||||||
return _data.albumTitleAsset;
|
return _data.albumTitleAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the offsets for the album title.
|
||||||
|
*/
|
||||||
|
public function getAlbumTitleOffsets():Null<Array<Float>>
|
||||||
|
{
|
||||||
|
return _data.albumTitleOffsets;
|
||||||
|
}
|
||||||
|
|
||||||
public function hasAlbumTitleAnimations()
|
public function hasAlbumTitleAnimations()
|
||||||
{
|
{
|
||||||
return _data.albumTitleAnimations.length > 0;
|
return _data.albumTitleAnimations.length > 0;
|
||||||
|
|
|
@ -112,7 +112,7 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
var albumGraphic = Paths.image(albumData.getAlbumArtAssetKey());
|
var albumGraphic = Paths.image(albumData.getAlbumArtAssetKey());
|
||||||
newAlbumArt.replaceFrameGraphic(0, albumGraphic);
|
newAlbumArt.replaceFrameGraphic(0, albumGraphic);
|
||||||
|
|
||||||
buildAlbumTitle(albumData.getAlbumTitleAssetKey());
|
buildAlbumTitle(albumData.getAlbumTitleAssetKey(), albumData.getAlbumTitleOffsets());
|
||||||
|
|
||||||
applyExitMovers();
|
applyExitMovers();
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
albumTitle.visible = true;
|
albumTitle.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildAlbumTitle(assetKey:String):Void
|
public function buildAlbumTitle(assetKey:String, ?titleOffsets:Null<Array<Float>>):Void
|
||||||
{
|
{
|
||||||
if (albumTitle != null)
|
if (albumTitle != null)
|
||||||
{
|
{
|
||||||
|
@ -206,6 +206,11 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
albumTitle = null;
|
albumTitle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (titleOffsets == null)
|
||||||
|
{
|
||||||
|
titleOffsets = [0, 0];
|
||||||
|
}
|
||||||
|
|
||||||
albumTitle = FunkinSprite.createSparrow(925, 500, assetKey);
|
albumTitle = FunkinSprite.createSparrow(925, 500, assetKey);
|
||||||
albumTitle.visible = albumTitle.frames != null && newAlbumArt.visible;
|
albumTitle.visible = albumTitle.frames != null && newAlbumArt.visible;
|
||||||
albumTitle.animation.addByPrefix('idle', 'idle0', 24, true);
|
albumTitle.animation.addByPrefix('idle', 'idle0', 24, true);
|
||||||
|
@ -219,6 +224,9 @@ class AlbumRoll extends FlxSpriteGroup
|
||||||
|
|
||||||
albumTitle.zIndex = 1000;
|
albumTitle.zIndex = 1000;
|
||||||
|
|
||||||
|
albumTitle.x += titleOffsets[0];
|
||||||
|
albumTitle.y += titleOffsets[1];
|
||||||
|
|
||||||
if (_exitMovers != null) _exitMovers.set([albumTitle],
|
if (_exitMovers != null) _exitMovers.set([albumTitle],
|
||||||
{
|
{
|
||||||
x: FlxG.width,
|
x: FlxG.width,
|
||||||
|
|
Loading…
Reference in a new issue