Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center Text inside doublebox #5

Open
FuckingToasters opened this issue Feb 17, 2022 · 3 comments
Open

Center Text inside doublebox #5

FuckingToasters opened this issue Feb 17, 2022 · 3 comments

Comments

@FuckingToasters
Copy link

FuckingToasters commented Feb 17, 2022

Hello, i tried multiplie things but im somehow not able to center Text inside a double box. everytime i try it the box becomes too large, the whole box with the text inside is centered etc. but the thing i actually want is that the box stay the same without being centerd and only the text inside the box should be centerd.

def banner():
    logo = r"""
    ███████╗ ██████╗ ██████╗ ██╗   ██╗███╗   ███╗    ████████╗ ██████╗  ██████╗ ██╗     ███████╗
    ██╔════╝██╔═══██╗██╔══██╗██║   ██║████╗ ████║    ╚══██╔══╝██╔═══██╗██╔═══██╗██║     ██╔════╝
    █████╗  ██║   ██║██████╔╝██║   ██║██╔████╔██║       ██║   ██║   ██║██║   ██║██║     ███████╗
    ██╔══╝  ██║   ██║██╔══██╗██║   ██║██║╚██╔╝██║       ██║   ██║   ██║██║   ██║██║     ╚════██║
    ██║     ╚██████╔╝██║  ██║╚██████╔╝██║ ╚═╝ ██║       ██║   ╚██████╔╝╚██████╔╝███████╗███████║
    ╚═╝      ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚═╝       ╚═╝    ╚═════╝  ╚═════╝ ╚══════╝╚══════╝                                  
    """
    # Write.Print(Box.DoubleCube(Center.Center(logo)), Colors.blue_to_green, interval=0.00)
    Anime.Fade(Box.DoubleCube(Center.XCenter(logo)), Colors.red_to_purple, Colorate.Vertical, interval=0.025, enter=False)

banner()

grafik

@billythegoat356
Copy link
Owner

Hello
The text should be centered by default.

Try removing this space: it could be causing the problem
image

@FuckingToasters
Copy link
Author

FuckingToasters commented Apr 8, 2022

@billythegoat356
Hello, I now have an similar issue. I started using this libary again but what now happen is, that the banner is printed a lot and the input won't even popup:

import os
import pystyle
def logo():
    font = """
        ███╗   ██╗██╗████████╗██████╗  ██████╗     ██████╗ ███████╗██████╗ ███████╗███████╗███╗   ███╗███████╗██████╗     
        ████╗  ██║██║╚══██╔══╝██╔══██╗██╔═══██╗    ██╔══██╗██╔════╝██╔══██╗██╔════╝██╔════╝████╗ ████║██╔════╝██╔══██╗    
        ██╔██╗ ██║██║   ██║   ██████╔╝██║   ██║    ██████╔╝█████╗  ██║  ██║█████╗  █████╗  ██╔████╔██║█████╗  ██████╔╝    
        ██║╚██╗██║██║   ██║   ██╔══██╗██║   ██║    ██╔══██╗██╔══╝  ██║  ██║██╔══╝  ██╔══╝  ██║╚██╔╝██║██╔══╝  ██╔══██╗    
        ██║ ╚████║██║   ██║   ██║  ██║╚██████╔╝    ██║  ██║███████╗██████╔╝███████╗███████╗██║ ╚═╝ ██║███████╗██║  ██║    
        ╚═╝  ╚═══╝╚═╝   ╚═╝   ╚═╝  ╚═╝ ╚═════╝     ╚═╝  ╚═╝╚══════╝╚═════╝ ╚══════╝╚══════╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝    
    """

    menu = """
        [01] Classic Nitro
        [02] Soon
        [03] Soon
        [04] Soon
        [05] Soon
    """
    # Anime.Fade(Box.DoubleCube(Center.XCenter(logo)), Colors.red_to_purple, Colorate.Vertical, interval=0.025, enter=False)
    pystyle.Anime.Fade(pystyle.Center.XCenter(f"{pystyle.Box.DoubleCube(font)}\n{menu}"), pystyle.Colors.red_to_purple,  pystyle.Colorate.Vertical, interval=0.1)
    # print(f"{font}\n{menu}")
    option = pystyle.Write.Print("\t\t[*] Select an option: ", pystyle.Colors.red_to_purple, interval=0.05)

    if option != "1" and option != "2" and option != "3" and option != "4" and option != "5":
        print("\t\t[!] Invalid option")
        os.system("cls" if os.name == "nt" else "clear")
        logo()

    return option

@billythegoat356
Copy link
Owner

its because you animated it, dont use Anime

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

No branches or pull requests

2 participants