Author Topic: Filtering on the zoomable image tag.  (Read 1220 times)

Calin Leafshade

  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on one or more games that won an AGS Award!
    •  
    • Calin Leafshade worked on one or more games that was nominated for an AGS Award!
Filtering on the zoomable image tag.
« on: 05 Feb 2013, 21:38 »
Since the zoomable image tag is exclusively used for pixel art it might be a good idea to use css attribs which make the image resize with a nearest neighbour algorithm.

AGA

  • Adventure Game Aficionado
  • Administrator
  • Mittens Deity
  • ¡Qué alí­vio!
    • Lifetime Achievement Award Winner
    • AGA worked on one or more games that won an AGS Award!
    •  
    • AGA worked on one or more games that was nominated for an AGS Award!
Re: Filtering on the zoomable image tag.
« Reply #1 on: 05 Feb 2013, 22:30 »
It uses this plugin.  If you want to work out how to make it do that, then by all means let me know how and I'll implement it.

Calin Leafshade

  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on one or more games that won an AGS Award!
    •  
    • Calin Leafshade worked on one or more games that was nominated for an AGS Award!
Re: Filtering on the zoomable image tag.
« Reply #2 on: 05 Feb 2013, 23:24 »
in modification2.xml change the function below:

Code: Javascript
  1. function setZoomLevel(obj, lvl)
  2. {
  3.         obj = obj.parentNode.parentNode;
  4.         img = new Image();
  5.         realImg = obj.getElementsByTagName("img")[0];
  6.         img.src = realImg.src;
  7.         realImg.width = img.width * lvl;
  8.         realImg.height = img.height * lvl;
  9.         obj.style.width = realImg.width + "px";
  10.         obj.style.cssText += "image-rendering: -moz-crisp-edges; -ms-interpolation-mode: nearest-neighbor;";
  11. }
  12.  

untested but that should work.

AGA

  • Adventure Game Aficionado
  • Administrator
  • Mittens Deity
  • ¡Qué alí­vio!
    • Lifetime Achievement Award Winner
    • AGA worked on one or more games that won an AGS Award!
    •  
    • AGA worked on one or more games that was nominated for an AGS Award!
Re: Filtering on the zoomable image tag.
« Reply #3 on: 06 Feb 2013, 08:44 »


Looks pretty good to me?