Closed flaaws closed 1 year ago
Check if the state you did is extending MusicBeatState
.
Check if the state you did is extending
MusicBeatState
.
yep
bumping, not sure if this helps or not
Are you using LoadingState.loadAndSwitchState(new MainMenuState()); ? Did you fuck up the CustomFadeTransition?
Are you using LoadingState.loadAndSwitchState(new MainMenuState()); ? Did you fuck up the CustomFadeTransition?
I wasnt, but when i did it still didn't fix my issue. I didn't touch anything related to that state, every other state has a transition other than the ones ive made
Then USE the MusicBeatSubstate. I don't have your "source code" for this.
Then USE the MusicBeatSubstate. I don't have your "source code" for this.
wdym use the music beat substate???? sorry if i seem dumb but i have no idea how to do that.
heres the code for switching states
` if(FlxG.mouse.overlaps(collectionmenu)){ if(FlxG.mouse.justPressed){ FlxTween.tween(FlxG.camera, {zoom: 1.025}, 1, {ease: FlxEase.expoOut});
FlxG.sound.play(Paths.sound('confirmMenu'));
LoadingState.loadAndSwitchState(new CollectionsState());
}
}`
and heres the actual code for the state it goes to.
`package;
import Discord.DiscordClient;
import flash.text.TextField; import flixel.FlxG; import flixel.FlxSprite; import flixel.addons.display.FlxGridOverlay; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.math.FlxMath; import flixel.text.FlxText; import flixel.util.FlxColor; import flixel.addons.transition.FlxTransitionableState; import flixel.tweens.FlxTween; import flixel.tweens.FlxEase; import flixel.input.mouse.FlxMouseEventManager;
import sys.FileSystem; import sys.io.File;
import lime.utils.Assets;
using StringTools;
class CollectionsState extends MusicBeatState { var bg = new FlxSprite().loadGraphic(Paths.image('creditsMenu/bgGradient')); var textcollect = new FlxSprite().loadGraphic(Paths.image('collectionsMenu/collectionText')); var button1 = new FlxSprite(320, FlxG.height 0.1).loadGraphic(Paths.image('collectionsMenu/remixesButton')); var button2 = new FlxSprite(550, FlxG.height 0.1).loadGraphic(Paths.image('collectionsMenu/coversButton')); var button3 = new FlxSprite(775, FlxG.height * 0.1).loadGraphic(Paths.image('collectionsMenu/challengeButtonGreyedOut'));
var curSelected:Int = -1;
var offsetThing:Float = -75;
override public function create():Void
{
#if desktop
DiscordClient.changePresence("in da collections", null);
#end
transIn = FlxTransitionableState.defaultTransIn;
transOut = FlxTransitionableState.defaultTransOut;
FlxG.mouse.visible = true;
FlxG.sound.music.fadeIn(0.3, 0, 0.2);
}
override public function update(elapsed:Float):Void
{
persistentUpdate = false;
add(bg);
bg.screenCenter();
add(textcollect);
textcollect.screenCenter();
add(button1);
button1.alpha = 0.4;
add(button2);
button2.alpha = 0.4;
add(button3);
button3.alpha = 0.4;
//button one
if(FlxG.mouse.overlaps(button1)){
button1.alpha = 1;
}
else
{
button1.alpha = 0.5;
}
//button two
if(FlxG.mouse.overlaps(button2)){
button2.alpha = 1;
}
else
{
button2.alpha = 0.5;
}
//button 3
if(FlxG.mouse.overlaps(button3)){
button3.alpha = 1;
}
else
{
button3.alpha = 0.5;
}
//remixes
if(FlxG.mouse.overlaps(button1)){
if(FlxG.mouse.justPressed){
FlxTween.tween(FlxG.camera, {zoom: 1.025}, 1, {ease: FlxEase.expoOut});
FlxG.sound.play(Paths.sound('confirmMenu'));
LoadingState.loadAndSwitchState(new RemixesState());
}
}
//covers
if(FlxG.mouse.overlaps(button2)){
if(FlxG.mouse.justPressed){
FlxTween.tween(FlxG.camera, {zoom: 1.025}, 1, {ease: FlxEase.expoOut});
FlxG.sound.play(Paths.sound('confirmMenu'));
LoadingState.loadAndSwitchState(new CoversStates());
}
}
//challenge songs
if(FlxG.mouse.overlaps(button3)){
if(FlxG.mouse.justPressed){
FlxG.sound.play(Paths.sound('errorMenu'));
FlxG.camera.shake(0.005,0.25,null,true,X);
}
}
if (FlxG.sound.music.volume < 0.7)
{
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
}
if (controls.BACK)
{
FlxG.sound.play(Paths.sound('cancelMenu'));
MusicBeatState.switchState(new MainMenuState());
}
}
}`
Yeah I can kinda see your "issue"; MainMenuState isn't a MusicBeatState Extender.
Describe your problem here.
heyo! made a new state for my mod, and it works and everything, but it doesnt have a smooth transition upon opening it.
see video.
https://user-images.githubusercontent.com/88951878/195874804-badb4772-0b67-4928-8022-d4953a413b4c.mp4
see how it just snaps to the next state rather than fading to it? how would I fix that?
Are you modding a build from source or with Lua?
Source
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Made a new state.