It is currently 08 Sep 2025, 02:29
   
Text Size

r22669 : Card Zoomer!

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

r22669 : Card Zoomer!

Postby spr » 23 Jul 2013, 03:33

Here is a feature that I think has been missing in Forge - a card zoomer! Now you can gaze at your HQ images in all their glory with just a flick of the mousewheel -

zoomer.png


Instructions :
- Works on any card image in the Deck Editor or Duel screen.
- Move your mouse over the card you want to zoom and mouse-wheel forward.
- Mouse-wheel back, mouse click or pressing ESC closes the zoomed image.

Limitations :
- Only works with the mouse wheel at the moment.
- Does not show the other side of double-sided cards yet.

WIP :
- Press and hold the CTRL key while mousing over a card to see zoomed image.
- Flipping double-sided card.

Tested :
- Deck editor.
- Duel screen.

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: r22669 : Card Zoomer!

Postby Agetian » 23 Jul 2013, 03:46

This is great, thanks so much! :thumbsup: As an extra idea, maybe it'd be possible to add a key shortcut to the "zoomed in" view to flip the card 90 degrees, such as for the split cards or for the planes in Planechase? (just an idea)

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: r22669 : Card Zoomer!

Postby spr » 23 Jul 2013, 09:15

Agetian wrote:...maybe it'd be possible to add a key shortcut to the "zoomed in" view to flip the card 90 degrees, such as for the split cards or for the planes in Planechase? (just an idea)
- Agetian
Thanks for pointing these formats out Agetian. Consider "rotation" added to the TODO list.

Cheers,
Steve.
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: r22669 : Card Zoomer!

Postby drdev » 29 Jul 2013, 00:48

FYI, I committed a change so that card zoom can also be opened by holding the middle mouse button down or holding both the left and right mouse buttons down. If opened this way, it will close as soon as you release the mouse button(s).
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: r22669 : Card Zoomer!

Postby spr » 29 Jul 2013, 15:32

drdev wrote:(PM continued...)For single button mice, we could add a keyboard shortcut that zooms the card under the mouse if we wanted. MTGO supports holding Ctrl+Shift, but their zoom is slightly different in that you can move the mouse around while the mouse button/keyboard keys are down to zoom different cards. Plus Ctrl+Shift would make it hard to use Ctrl+Shift as modifiers for any keyboard shortcuts we might want to support.
I was kind of half joking when I mentioned one button mice/mouse! :D Still, if they do exist then the solution I came up with before your double-button solution might help. That is, while hovering the mouse pointer over an image the user can press and hold CTRL to preview the zoomed image. In fact, that is a buttonless solution! 8)

drdev wrote:On that note, are there keyboard shortcuts for anything in Forge? Particularly one to accept the current game prompt or end the turn (auto-accepting prompts that allow it, only stopping if a prompt that can't be auto-accepted is encountered, like declare attackers/blockers). MTGO uses F2 and F6 for those, though they're configurable.
Check out the Keyboards shortcut section in Game Settings -> Preferences.

Cheers,
Steve.
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: r22669 : Card Zoomer!

Postby moomarc » 29 Jul 2013, 17:20

With regards to the keyboard shortcuts, the two you asked specifically about would be either space bar or enter to pass priority (Myk spent quite a bit of time trying to make sure that something relevant always has priority and in certain pop ups space and enter have different functions). 'E' is the default shortcut to end turn, although you generally need to pass priority before it skips ahead. Some time back it started only skipping to end of combat. I'm not sure if that was so that user can skip to main 2 quickly or if it was accidental.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: r22669 : Card Zoomer!

Postby spr » 06 Aug 2013, 00:57

r22808
  • Introducing FImagePanel, a replacement for ScaledImagePanel. It can be used to display, scale and rotate a BufferedImage and has been optimized for efficient resizing of the image.
  • FImagePanel will be required by CardZoomer for handling split cards.
  • CardPicturePanel which is used to preview a card image on the deck, match views and various other GUI elements now uses FImagePanel instead of ScaledImagePanel. This has significantly reduced the load on the image cache...

Prior to r22808, whenever CardPicturePanel was resized or repainted it would ask the image cache for the image scaled to its current dimensions. If the required image was not available the cache manager would load the original image, re-sample it to the required size, add it to the cache and return it to CardPicturePanel for display.

It did this everytime a resize event was fired! #-o So, by resizing the panel in the deck editor or match screen I could easily generate 300+ images in the cache in seconds, all of the same image, each with a slightly different width and/or height.

Now, CardPicturePanel in conjunction with FImagePanel requests the original image once from the cache and leaves the scaling to FImagePanel.

Please note this only applies to card preview panel - the game, hand areas etc still use the old way. I think they could benefit but for now I want to monitor this single update since there is quite a bit of new code and I am pessimistic by nature. :wink:

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: r22669 : Card Zoomer!

Postby drdev » 06 Aug 2013, 01:11

Nice work. I'll have to look into your code when I start working on card view for Deck Editor.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: r22669 : Card Zoomer!

Postby Agetian » 06 Aug 2013, 03:31

Good job, thanks for working on improving the UI!

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: r22669 : Card Zoomer!

Postby spr » 06 Aug 2013, 18:23

r22818:
- Split cards are now rotated properly.

To-Do:
- Display the alternative image associated with double-sided and flip cards.
- Display inventory items (booster packs, etc).

Cheers,
Steve.
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Re: r22669 : Card Zoomer!

Postby moomarc » 06 Aug 2013, 20:06

spr wrote:r22818:
- Split cards are now rotated properly.

To-Do:
- Display the alternative image associated with double-sided and flip cards.
- Display inventory items (booster packs, etc).

Cheers,
Steve.
Great work so far, so I just want to put my 5cents in before you go too much further. I would love it if the end product of the card zoomer does what it does now, bringing up the card at a specific rotation based on the card type. But then I would love it if there were view controls that allowed you to rotate the cards in increments of 90 degrees and/or flip the card. Transform cards would obviously show the flip side and all others would show the card back. Then archenemy schemes planechase planes could show off their fancy backs at last. Let me know if there's any chance that I can look forward to it sometime in the future or if its beyond the scope of your planned implementation (or if its incompatible with the multiple methods of bringing up the card viewer).
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: r22669 : Card Zoomer!

Postby friarsol » 06 Aug 2013, 20:12

moomarc wrote:But then I would love it if there were view controls that allowed you to rotate the cards in increments of 90 degrees and/or flip the card. Transform cards would obviously show the flip side and all others would show the card back. Then archenemy schemes planechase planes could show off their fancy backs at last.
Don't forget seeing the front of a Morph you control.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: r22669 : Card Zoomer!

Postby moomarc » 06 Aug 2013, 20:58

friarsol wrote:Don't forget seeing the front of a Morph you control.
That was one of the intended side effects of my request. :twisted:
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: r22669 : Card Zoomer!

Postby Marek14 » 06 Aug 2013, 21:45

friarsol wrote:
moomarc wrote:But then I would love it if there were view controls that allowed you to rotate the cards in increments of 90 degrees and/or flip the card. Transform cards would obviously show the flip side and all others would show the card back. Then archenemy schemes planechase planes could show off their fancy backs at last.
Don't forget seeing the front of a Morph you control.
Technically, it would be nice to see front of Morph opponents control if one of the following conditions is satisfied:
1) The permanent was face-up on the battlefield at some point.
2) You controlled the permanent at some point.
3) You controlled the permanent's controller at some point (with Mindslaver etc.).
4) You looked at the permanent (for example with Aven Soulgazer).
5) The permanent was cast from zone you could see (from hand with Telepathy or similar).
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 303 times

Re: r22669 : Card Zoomer!

Postby spr » 06 Aug 2013, 22:23

moomarc wrote:...But then I would love it if there were view controls that allowed you to rotate the cards in increments of 90 degrees and/or flip the card. Transform cards would obviously show the flip side and all others would show the card back. Then archenemy schemes planechase planes could show off their fancy backs at last. Let me know if there's any chance that I can look forward to it sometime in the future or if its beyond the scope of your planned implementation (or if its incompatible with the multiple methods of bringing up the card viewer).
Thanks for your thoughts. I have actually have been using a mouse wheel implementation for flip and double-sided cards and hope to release the code sometime this week. Basically, after opening the zoom view with the mouse wheel, you can then flick the wheel forward again and if it is a flip card it will be rotated 180 degrees and if it is a double-sided card it will show the other side. Rotate mouse wheel forward again to repeat. Its fast and simple...if you have got a mouse wheel and use the zoomer this way! :wink:

Once that is done I am planning on taking a look at background downloading of images so the additional stuff (morphs, planeswalker, etc) will have to wait or maybe it can be an interesting project for someone else.

Cheers,
Steve
User avatar
spr
 
Posts: 213
Joined: 06 Jul 2013, 19:31
Has thanked: 28 times
Been thanked: 60 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 50 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 50 users online :: 0 registered, 0 hidden and 50 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 50 guests

Login Form