At the core, I am mixing the concept of a loading bar with a Button. With my limited knowledge, I do not know if I could even animate a ProgressBar inside a Button. Layering at least two items over each other could provide the illusion of a single button. For the purpose of presenting an individual "button" in code, the visuals could stay together in a single Table object. I will test the idea soon, but I believe one Table can hold another Table. Thus, a Table object revealing multiple "fake buttons" should work.

Would anyone have a better idea? Thank you for bearing with me.

Last edited by shatterblast on Sat Jan 20, 2018 8:51 pm, edited 1 time in total.

True, and a ProgressBar could be shaped to look like a specific Button. Even the Actions class could be used for a ".fadeOut()" effect to another Button, and a separate Label could be kept over them so that the text does not fade.

Sorry, bad wording. Use a style with no background on the Button. Add your Progress Bar to the button.

Although the ClickListener on a ProgresBar may be fine. The downside is it won't support disabled state and toggling without you coding it yourself. Amd with the button, you could give it a nine patch background that surrounds your progress bar and reacts to touches with color changes.

Thank you for the clarity. Due to the suggestions, I believe I understand finally the "java.lang.String styleName" part of ProgressBar's second constructor. It functions along with the "Style" heading in the top-right of Raeleus's Skin Composer. I think this path should serve well for modifying the height of a horizontally placed ProgressBar. Otherwise, my attempts at changing just the height in code fail. (My current "skin" has a few extra choices for the size in it.)

I think this is enough information to point me in the right direction. Thank you again all for contributing!

Second Edit: Success! I will post the code in the message of my next reply.

First Edit: It seems that a single Cell will accept only one Actor. Stack should work, and apparently, I missed that part in the wiki. I guess a Cell is required for easy changes of an Actor in a Table or Button.

Old Message:I could use some insight on how to center a Label within a Button, please. Modifying the Cell affects the ProgressBar but not the Label. Several methods for directly re-sizing the Label do not seem to work either.

//------------------------------------------------------------------------------------------------------------------------ //This is for stuffing as much as possible from the "create()" method of this class into a different class file. //Hopefully in the future, this will allow the creation and disposal of battle sequences without exiting the main program. separation = new SSSTest_Attempt_to_Separate( stage, skin, this ); separation.decouple_From_Rear_First(); //------------------------------------------------------------------------------------------------------------------------

allow_FirstLoad_in_RenderMethod = false;

scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor( 1 );

}

orthoCamera.update();

//The animation seems to still run even with the following line disabled. spriteBatchTest.getProjectionMatrix().set( orthoCamera.combined );

//________________________________________________________________________________________________________________________________________ //The following code is necessary for animations. "AssetManager" DOES NOT HANDLE "SpriteBatch". spriteBatchTest.begin();

//The below line is necessary for the correct rendering of animation colors. spriteBatchTest.setBlendFunction( 770, 771 );

//... Spine stuff ...

spriteBatchTest.end();

separation.barMove( renderDelta );

stage.act(); stage.draw();

}

@Override public void resize ( int width, int height ) {

//The below line seems to necessary at least for the Spine animations to render. orthoCamera.setToOrtho( false );

//I am not sure what the below line is for, but the Spine animations do not seem to require it. stage.getViewport().setScreenSize( width, height );

}

//Might cause a memory leak if left out. @Override public void dispose() {

//TODO Next thing for modification. A timer like the ".barMove()" method should be used for the future ProgressBar. //----------------------------------------------------------------------------------------------------- saphirelMenuButton01.addListener( new TextTooltip( "Graphics only for now.", skin )); saphirelMenuButton01.addListener( new ChangeListener() { public void changed ( ChangeEvent event, Actor actor ) {

//The ".alpha()" method starts invisible. The ".fadeIn()" method specifies how many //seconds it will take to arrive at full visibility. table.addAction( Actions.alpha( 0f )); table.addAction( Actions.fadeIn( 5f ));

//The line below is just for testing the ".alpha()" method of "Actions". The method is available for //scene2d stuff generally. The variable sets the desired alpha level. There is an //overloaded version also available that allows an animation to change to a different value over //time. timeCount_ProgressBar.addAction( Actions.alpha( 0.7f ) );

//While this "setAnimateDuration" of "1f" is redundant, it overwrites the ".001f" //inside the following "if" statement, so it will react at a normal pace. timeCount_ProgressBar.setAnimateDuration( 0.5f ); progress.setAnimateDuration( 0.01f );