In-Browser Sprite Viewer

Started by Trojal, Aug 21, 2011, 01:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Trojal

In-Browser Sprite Viewer
http://ro.trojal.net/canvas.php
By: [email protected]
Version: 1.4
Compatible with: Firefox 6, Chrome
Last Updated: 2011-08-23

Screenshots:


Why?
I became inspired by Keyworld's RO-in-browser work that's being done in the HTML canvas element, so I decided to see if I could come up with something useful too.

What?
I wrote some Javascript code --no server-side code at all -- that fetches a .spr file (following Javascript's same-domain restriction for now) and parses the images and loads its frames in multiple canvas elements.

Details:
It uses Javascript's ArrayBuffer to read binary data, which isn't supported in many browsers -- I tested it in Firefox 6 and Chrome, and it works in those, but I'm not sure what other browsers. I have uploaded 8 sprite files for now, to demo the software. You can also download the webpage to your local machine and load .spr files that way, since it's entirely client code.  ;D

Right now it's mostly a proof-of-concept since the .spr files have to be on the same domain as the requesting page, but that's not too hard to work around; but I don't know what sort of people would have interest in a .spr parser anyways, so I can tailor it to do something once I find out what it would be useful for. Let me know if someone would have use for this sort of thing, and I can make it more exciting.

EDIT v.1.3: Now supports drag-and-drop of .spr file(s) to be parsed.

Changelog:
Version 1.4: Supports the additional rgba images found in some sprites.
Version 1.3: Allows drag-and-drop of .spr file(s) into the page to be parsed locally (not uploaded).
Version 1.2: Draws image-at-once instead of drawing a 1x1 rectangle for each pixel.
Version 1.1: Handles alpha channel in sprite images.
Version 1.0: Initial version.
TitanRO 5/5/3 Revo-Classic: No donations, no cash shop.

yC

Hey that's neat.  Well I had an idea that needed something like that before.

I thought of showing the headgear frames on the item database a long time ago but never implemented it because the amount of time needed to process the spr from spr to frame then to gif etc will kill my life.

I am sure graphic people would fine better use of this.

Syron

This is very nice, good work

Trojal

#3
Significant update in Version 1.3:
Allows drag-and-drop of .spr file(s) into the page to be parsed locally (not uploaded).

It also allows multiple files to be dropped simultaneously (I wouldn't recommend trying a lot at once unless you're just stress-testing the application). Also displays filename before the sprite frames now.

EDIT:
Version 1.4:
Supports the additional rgba images found in some sprites.
TitanRO 5/5/3 Revo-Classic: No donations, no cash shop.

KawaiiOverdose

This is a life saver since the other sprite loader closed down ^_^  /lv

Gardosen

is the site down? its not loading for me  /wah

Zhin

Oh this is lovely. o:  Thank you to KawaiiOverdose and Gardosen for necroposting this gem to the top XD


Axis~