fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Generate button letters A, B, E, H, P, R, S and new Battle Only button

Open zenseii opened this issue 3 years ago • 2 comments

Close https://github.com/ihhub/fheroes2/issues/5234

With letter spacing fixed we can close https://github.com/ihhub/fheroes2/issues/5858

The 'A' is different from the OG since the automatic shadowing etc is different and I had to add a pair of pixels to fill some gaps. image

In the future it should be made possible to have the letter spacing be 2px smaller (i.e. 1px on each side of a letter) so that the buttons matche the OG main menu buttons:

image

image

zenseii avatar Sep 18 '22 15:09 zenseii

Current issues with translation is that if the translated string contains either \n or a white space then they will count as invalid characters and the English string will be used.

zenseii avatar Sep 18 '22 21:09 zenseii

Hi @zenseii , to fix 2 pixel space we need to apply a shift for them. Try to add this code at the end of generateBaseButtonFont() function:

for ( Sprite & letter : released ) {
    letter.setPosition( -2, 0 );
}

for ( Sprite & letter : pressed ) {
    letter.setPosition( -2, 0 );
}

I think it should help to solve your concern. Also please note that this shift will be applied for the first letter in every button.

ihhub avatar Sep 19 '22 15:09 ihhub

@zenseii , huge thanks for this useful improvement!

ihhub avatar Sep 21 '22 12:09 ihhub