Skip to content

Added animated symbolic dice button#14581

Open
cholmcc wants to merge 1 commit into
vassalengine:release-3.7from
cholmcc:cholmcc_animated_dice-3.7
Open

Added animated symbolic dice button#14581
cholmcc wants to merge 1 commit into
vassalengine:release-3.7from
cholmcc:cholmcc_animated_dice-3.7

Conversation

@cholmcc

@cholmcc cholmcc commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

This adds the possibility to add one or more animated dice to a module. The dice are animated using the defined images with configurable number of frame and frames per second.

One class AnimatedDiceButton has been added, as well as some translatable strings, and the documentation has been updated.

Dice like these can be added by Add Symbolic Dice (animated) in the module context menu.

Closes #14306

This adds the possibility to add one or more animated dice to a module.
The dice are animated using the defined images with configurable number
of frame and frames per second.

One class `AnimatedDiceButton` has been added, as well as some
translatable strings, and the documentation has been updated.

Dice like these can be added by `Add Symbolic Dice (animated)` in the
module context menu.
@cholmcc

cholmcc commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator Author

Animated symbolic dice in VASSAL

Here is a component that allows one to make animated symbolic dice in VASSAL. It extends the functionality of SpecialDiceButton to allow for animation of the dice.

The animation is done by picking, at random, some number of other die faces than the result, rotating these faces at random, and then showing each image in turn until the last image which is the result of the die roll.

animdice

@djberg96

Copy link
Copy Markdown
Contributor

Looks neat! Is it possible to add a sound to the animation, so I can make it sound like rolling dice?

@cholmcc

cholmcc commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator Author

Looks neat! Is it possible to add a sound to the animation, so I can make it sound like rolling dice?

Yes, you can. As this component inherits everything from Symbolic Dice Button, it also inherits the configurations

  • Play a sound
  • Sound Clip

Ideally, the animation would in that case be as long as the sound clip, or vice versa. For now, make sure that the product of the configurations

  • Number of animation steps before result (steps)
  • Frames per second (FPS)
    is roughly the same duration as your sound clip. That is, if your sound clips is duration long in seconds, then aim for
duraction = FPS * steps

Yours,
Christian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants