zengm icon indicating copy to clipboard operation
zengm copied to clipboard

Export player as a trading card image

Open dumbmatter opened this issue 3 years ago • 10 comments

See https://old.reddit.com/r/BasketballGM/comments/rt7szv/monthly_suggestions_thread/hty3yug/ - if you have some legendary player, his player profile page is huge. It'd be cool to be able to condense it into a small summary, maybe similar to a trading card, and let that be downloaded as an image.

Figuring out the design is the hard part. Both making it look nice, and figuring out how to best condense player stats/awards/etc.

The actual implementation, either you could do it or I could do it. But really the problem is a design problem. If I knew what I was trying to make, I could do it pretty easily.

dumbmatter avatar Feb 03 '22 04:02 dumbmatter

Hey dude I'm a fan of the game, can you check out this design I created:

https://codepen.io/itamartati/pen/MWPebRV

ItamarTati avatar Apr 17 '23 11:04 ItamarTati

@ItamarTati it looks nice!

dumbmatter avatar Apr 17 '23 21:04 dumbmatter

Nice, can I try to implement it? @dumbmatter.

So I'll create a pr.

ItamarTati avatar Apr 17 '23 22:04 ItamarTati

Sure. Ideally it'd download that as an image, I'm not sure how easy that is to do. The built-in screenshot functionality uses html2canvas which you could use here too, but it's not perfect, some stuff gets lost.

dumbmatter avatar Apr 18 '23 05:04 dumbmatter

Average PER or GameScore might be nice?

radholm avatar Apr 19 '23 19:04 radholm

Yes will add, sounds great

ItamarTati avatar Apr 19 '23 20:04 ItamarTati

I like the design! I can share an alternative. The interesting thing is that it needs to work with generated player images and real player images. I believe they both have transparent backgrounds though which will make it easier.

radholm avatar Apr 19 '23 21:04 radholm

Will do, sorry it's taking me some time, just sorting out some things IRL and also going through the code. I do have one question about implementation. Do we want this trading card to be somewhere on the player page (if so where?) or do we want this be somewhere else on it's own. Sorry if the answer is somewhere, I can't find it :(

ItamarTati avatar Apr 20 '23 23:04 ItamarTati

Ideally it would link to an image, which could be generated directly (like using HTML Canvas) or similar to the built-in screenshot functionality (html2canvas). Honestly either way it's a little tricky...

dumbmatter avatar Apr 21 '23 03:04 dumbmatter

@dumbmatter sorry it took a while, had so many IRL things to do Here is the PR: https://github.com/zengm-games/zengm/pull/447

ItamarTati avatar May 14 '23 09:05 ItamarTati