New games every week!
JSE - Symbol Import Blog
7th July 2021
Michael Fernie requested this feature last night, and I was only too happy to oblige.
After all, it gave me something to do, today, other than more evil GUI work.. Bah, humbug!!

-=-=-

Unfortunately, to get this function working, I had to do a ton of entirely different GUI work!

The GUI bar has been mostly rewritten, and is now pure-HTML all the way.
Previously I would resort to Canvas based image-drawing and mouse functionality for the icons, wherever possible, to give me a little more control over how they work.
The import button, however, needs to be pure-HTML. Without it being that, the File Requester won't pop up. This is why the Export/Import buttons were on the main screen instead of being in the Project menu, where the main screen used HTML icons, but the Project menu had canvas based ones.

Adding an import button to the Symbol editor, however, required a rewrite of it's top-bar, to include a pure-HTML import button. And, well, if I'm doing that, I might as well do the rest, too.
Ugh..

So I did..
I spent a good couple of hours rejigging how the main GUI works, and it seems to now function in a more "normal" fashion.

Gud gud!

Meanwhile...



There's now an import button in the Symbol editor. It's up on the top right, next to the "Don't Save!" button.
Click it, then pick a .png or .jpg image.
Other image formats may work. Depends on "OMG Browser Compatibilities" stuff.

The editor will chop the image up into 32x32 chunks, (horizontally left to right, then rows top to bottom) and will attempt to convert each chunk into a symbol using the default palette.
(I DID try to make it scan through all the possible palettes to find the best one, but .. yeah, that got slow!!! I opted not to, in the end.)

Magenta (255,0,255) will be removed and used as Transparent.
If your image already has alpha transparency, anything below half-transparency becomes fully transparent, whilst anything above becomes solid.

The result should be a nice set of symbol data for all your favourite sprites.
It's not perfect. But it does the job.

If you choose to use this, I should probably do my best to persuade you to be as imaginative as you can, and not just rip a bunch of sprites from your favourite game.

Creativity is king.
Don't let your imagination stop at the first hurdle.

Symbol 0,"2__z,xw.yyz!2yz,xE7,vvw,7z,xxwwvvwxyz_zy.x?yz,xw,v.Exy!z!xyyxyyz.ywwv/wx!yxxy.xyz!ywv_w!yxw,xwwxz!ywv_vvw,xxwwvw,xyz/wv_vvw!v,wxyyz/Ev_vwZvwv/xyz/yv_vwvw,v/yz/ywv_v,wvwv/z@xwv_v_v,wz@xwwv.wv_v!wyz.2zzw,vvwv_v_yz.2zzxw,vvxxv_v/xz,22zzw,v,wyxxv_v?xz,y2zyxw,v,wxxwv/wwv.Exyz22yyxw,v?w.v,xyxv?w,yy2y,wvwv!w,v_wwvvwwyzy,wvvwv.wvxwv@wwvwvv7xy,zxwv@xwv/wwv!Ey,zyw/vvwwv,wwvvwvw,v.xy.xw?xw,v.xywwvvw,v.wy,zyw,xyzxvwwvvwyyw.vwv?wy.zxxwwyzzwvvwxyzyw/v.wy.z:zw,xyxwxyzzx,wwvvwv?wy.z::yxxwxw,x,yxv.wv!wy.z:,zzy,xyyzyxwvwvvwv!wy?:?z!ywv.w.v?wy?z:.z?yxv!wwv!wy?:;:,z?xv!w,v!wCxy,z:.z.ywv!w,v!wy.xz:.zzyxwv!w.v!w"; Graphics 512,512,1 AntiAlias Off SetSize 8 DrawImg ScreenWidth()/2,ScreenHeight()*0.4,0 SetSize 2 Text ScreenWidth()/2,ScreenHeight()*0.75,"8-bit Molly",1

Views 283, Upvotes 14  
Jse , Symbols
New games every week!
Site credits : Jayenkai made this.
(c) Jayenkai 2023 and onwards, RSS feed 4

Blog - JSE - Symbol Import - AGameAWeek