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

More customization options? #10

Open
SpaceLuc opened this issue May 28, 2023 · 11 comments
Open

More customization options? #10

SpaceLuc opened this issue May 28, 2023 · 11 comments
Assignees

Comments

@SpaceLuc
Copy link

Hey, would it be possible to make the individual cards customizable in size and position of the individual elements? Currently you have to stick to the default design and can only change the color of the text/bar.

I like the style of the third card (it's similar to mee6's), but it's way too big and takes up too much space in the chat.

Would love it if there was an option that you can set the positions and sizes of the individual elements. Kind of like a sandbox where you push everything to the right place yourself.

@krishsharma0413
Copy link
Owner

sounds interesting!

Though i need more info on this about what exactly you are looking for with examples.

@krishsharma0413 krishsharma0413 self-assigned this May 28, 2023
@SpaceLuc
Copy link
Author

In simple words: I want to have some variables to set the size and coordinates of each element. So I can make the user image a little smaller and move it to another place or just move the text a bit. Also the possibility to set the size of the background image and the "black frame" would be great.

@krishsharma0413
Copy link
Owner

ahhh not bad of an idea!
i will look into this immediately and most likely update the library within two day.
please test and give your feedback when it is done.

PS. if you like the library then staring the repo really keeps me motivated. ❤

@SpaceLuc
Copy link
Author

Thanks, I will give you feedback once you are done

PS. you have now another star 😉

krishsharma0413 added a commit that referenced this issue May 28, 2023
krishsharma0413 added a commit that referenced this issue May 29, 2023
@krishsharma0413
Copy link
Owner

krishsharma0413 commented May 29, 2023

good evening SpaceLuc,
I added something and I really want you to test it out because I don't have a discord bot to test on.

I added Sandbox class to create custom card1
if constantly changing code and running discord bot to see your custom card becomes tedious, I added Tester class.
I also added another Example folder for how to use the tester class.

Current sandbox only has one method which helps with customizing card1 only.

you can also resize the result image with resizeattribute available incard1, card2, card3` and sandbox card1

examples.

white_card1

blue_card1

black_card1

example code should look something like:

from DiscordLevelingCard import Sandbox, Settings, Tester
import asyncio
from PIL import Image

setting = Settings(
    background="./bg.jpg",
    bar_color="white",
    text_color="white")

async def main():
    rank = Sandbox(
        username="resetxd",
        level=10,
        current_exp=100,
        max_exp=400,
        settings=setting,
        avatar=Image.open("./avatarimg.png")
    )
    await rank.custom_card1(card_colour="blue") # "blue" or "#0000FF" both should work
    Image.open(result).save("result.png", "PNG")


asyncio.run(main())

Do you like this feature?
I loved it 🎉

@SpaceLuc
Copy link
Author

Hey! Thanks for your efforts, the code works.

image

@krishsharma0413
Copy link
Owner

Why is there a black line on the red card? It came at first on mine as well but then i recreated the asset to fix it. I think your system is cacheing the old asset instead of download the new one

@SpaceLuc
Copy link
Author

idk ... but it seems that the image somehow shows through from below?

@krishsharma0413
Copy link
Owner

What? I didn't understand

@krishsharma0413
Copy link
Owner

If you fine with it, we should continue this on discord.

@SpaceLuc
Copy link
Author

yeah, sure i send you a fa

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