Adventure Game Studio

AGS Development => Site & Forum Reports => Topic started by: Calin Leafshade on Tue 05/02/2013 21:38:35

Title: Filtering on the zoomable image tag.
Post by: Calin Leafshade on Tue 05/02/2013 21:38:35
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.
Title: Re: Filtering on the zoomable image tag.
Post by: AGA on Tue 05/02/2013 22:30:58
It uses this (http://custom.simplemachines.org/mods/index.php?mod=930) 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.
Title: Re: Filtering on the zoomable image tag.
Post by: Calin Leafshade on Tue 05/02/2013 23:24:30
in modification2.xml change the function below:

Code (javascript) Select

function setZoomLevel(obj, lvl)
{
obj = obj.parentNode.parentNode;
img = new Image();
realImg = obj.getElementsByTagName("img")[0];
img.src = realImg.src;
realImg.width = img.width * lvl;
realImg.height = img.height * lvl;
obj.style.width = realImg.width + "px";
obj.style.cssText += "image-rendering: -moz-crisp-edges; -ms-interpolation-mode: nearest-neighbor;";
}


untested but that should work.
Title: Re: Filtering on the zoomable image tag.
Post by: AGA on Wed 06/02/2013 08:44:39
[imgzoom]http://www.adventuregamestudio.co.uk/forums/Smileys/AGS/smiley.gif[/imgzoom]

Looks pretty good to me?