Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: nemo on November 24, 2010, 06:39:55 pm

Title: 4-level grayscale sprite editor
Post by: nemo on November 24, 2010, 06:39:55 pm
edits 8x8 sprites.

[2nd]   to toggle the buffer pixel
[Alpha] to toggle the backbuffer pixel
[clear] to quit and export hex to Str1

hex is formatted like so:
[(buffer hex)](newline)[(backbuffer hex)]
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 24, 2010, 06:41:09 pm
great!  8x8?
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 24, 2010, 06:41:24 pm
yes, 8x8. edited in.
Title: Re: 4-level grayscale sprite editor
Post by: Munchor on November 24, 2010, 06:41:44 pm
yes, 8x8. edited in.


Already trying :)
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 24, 2010, 06:42:14 pm
perfect, ill download tonight ;)
Title: Re: 4-level grayscale sprite editor
Post by: calcdude84se on November 24, 2010, 06:42:32 pm
I saw you talking about this on IRC for Downsider.
I might try it out later :)
Title: Re: 4-level grayscale sprite editor
Post by: Munchor on November 24, 2010, 06:43:46 pm
Already tried looks great, I suggest setting one key to a specific colour, so that I don't have to press alpha 3 times :S
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 24, 2010, 07:03:58 pm
can't get onto my calc, can't send stuff :(

can you give the source?
Title: Re: 4-level grayscale sprite editor
Post by: Downsider on November 24, 2010, 08:18:01 pm
Well done! Works excellent. This will be a huge, huge use to me in the future  :D
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 24, 2010, 11:27:03 pm
Nice, but is it normal that I got this when trying to recall a string? ???
Title: Re: 4-level grayscale sprite editor
Post by: MRide on November 24, 2010, 11:31:54 pm
I'll have to try this out.  When I ever get around to making a greyscale game in Axe.
Which will be like 2020.
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 24, 2010, 11:37:05 pm
/me hopes it is sooner D: (well... after IQ is finished of course :P)
Title: Re: 4-level grayscale sprite editor
Post by: MRide on November 24, 2010, 11:46:58 pm
Yeah....I really need to have like a month with no school, then IQ will be perfected.  Xmas break is my planned finishing time, but who knows?
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 25, 2010, 07:50:12 am
Nice, but is it normal that I got this when trying to recall a string? ???

hmm I see nemo stores it as tokens... 

that's what I had before, I thought his would store as hex or something.  Well, then mine is betterer, it's easier to use, and has cool features like invert areas, scroll right/left/up/down, auto dither an output as B&W only.  I was just hoping he could show me a quick way to output the string in chars :(
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 25, 2010, 12:29:53 pm
Nice, but is it normal that I got this when trying to recall a string? ???

Dj, that is pretty odd. i have no idea what the problem is. if you recall the string in a program, it works perfectly, though. and there really isn't a reason to recall the string to the homescreen if you're using it for Axe anyway, so i don't think i'm going to investigate the problem.

Ashbad, outputting a hex string as tokens or ASCII is the same because you're only using 0-9 and A-F, which have the same token/ASCII values. or in my case i'm also adding in a newline token for Downsider's ease of use.

as for exporting the hex into a string, well, that's easy:
Code: [Select]
GetCalc("Str1",32)->P
"0123456789ABCDEF"->Str1
For(Y,0,7
For(Z,0,1
0->C->D
For(X,0,3
e^(3-X)*pxl-Test(Z*4+X,Y)+C->C
e^(3-X)*pxl-Test(Z*4+X,Y)r+D->D
End
{C+Str1}->{Y*2+Z+P}
{D+Str1}->{Y*2+Z+P+16}
End
End
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 25, 2010, 01:10:07 pm
oh, thanks man.  I was doing some weird other thing, since I was making my own routine to read nibbles (I can't get axe 0.4.5 onto my calc) and my way involved changing my memory buffers from a 64 byte map into two 64 byte maps into two 8 byte hex sprites, into two strings, into one string O.o

Though I guess pixel testing on the buffers for me would also work as well.

Thanks again. :)
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 25, 2010, 09:28:33 pm
Nice, but is it normal that I got this when trying to recall a string? ???

Dj, that is pretty odd. i have no idea what the problem is. if you recall the string in a program, it works perfectly, though. and there really isn't a reason to recall the string to the homescreen if you're using it for Axe anyway, so i don't think i'm going to investigate the problem.

Ashbad, outputting a hex string as tokens or ASCII is the same because you're only using 0-9 and A-F, which have the same token/ASCII values. or in my case i'm also adding in a newline token for Downsider's ease of use.

as for exporting the hex into a string, well, that's easy:
Code: [Select]
GetCalc("Str1",32)->P
"0123456789ABCDEF"->Str1
For(Y,0,7
For(Z,0,1
0->C->D
For(X,0,3
e^(3-X)*pxl-Test(Z*4+X,Y)+C->C
e^(3-X)*pxl-Test(Z*4+X,Y)r+D->D
End
{C+Str1}->{Y*2+Z+P}
{D+Str1}->{Y*2+Z+P+16}
End
End
Ah ok, well, before the junk, it seemed to show an hex string anyway, so it should be ok I guess. Note that I was using TI-83+SE OS 1.13 though, so that might be why. :P
Title: Re: 4-level grayscale sprite editor
Post by: Munchor on November 27, 2010, 09:30:12 am
oh, thanks man.  I was doing some weird other thing, since I was making my own routine to read nibbles (I can't get axe 0.4.5 onto my calc) and my way involved changing my memory buffers from a 64 byte map into two 64 byte maps into two 8 byte hex sprites, into two strings, into one string O.o

Though I guess pixel testing on the buffers for me would also work as well.

Thanks again. :)

You can't get Axe0.4.5, why?
Title: Re: 4-level grayscale sprite editor
Post by: calcdude84se on November 27, 2010, 12:13:38 pm
oh, thanks man.  I was doing some weird other thing, since I was making my own routine to read nibbles (I can't get axe 0.4.5 onto my calc) and my way involved changing my memory buffers from a 64 byte map into two 64 byte maps into two 8 byte hex sprites, into two strings, into one string O.o

Though I guess pixel testing on the buffers for me would also work as well.

Thanks again. :)

You can't get Axe0.4.5, why?
He doesn't have a link cable :(
Title: Re: 4-level grayscale sprite editor
Post by: ASHBAD_ALVIN on November 27, 2010, 12:31:52 pm
...that works with my calc, my mini usb port is busted, and radioshack didn't have anything that could remotely work.  I'l try best buy/ office depot.
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 27, 2010, 08:10:00 pm
alright, so i decided i'm actually going to do something with this. first thing is i need suggestions on the in-editor menu. it'll look, generally, as the attached picture. hopefully it's intuitive enough. you select an option, and a submenu comes up (that's what the dashes indicate). note that under the File tab, after you select New or Open and a size, the Monochrome, 3Lvl Gray, 4Lvl Gray and Masked submenu is implied. anyway, what are some suggestions for it? for example, for the Turn menu should i have it be Clockwise and CC, or Right and Left? i'm leaning to Right and Left because CC is too short but Counterclockwise is too long.
Title: Re: 4-level grayscale sprite editor
Post by: squidgetx on November 27, 2010, 08:14:38 pm
I think that it would be really cool if each individual menu comes up with F1, F2, F3 or something (Like 2.53 MP :P) That way we can look at the sprite and the menu at the same time. (especially necessary for the Draw menu commands)

As for Clockwise/CC vs Right/Left, Right/Left is probably better
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 27, 2010, 08:16:37 pm
that's how i have it set up (: the menu system is nearly completed (it's basically the tabs and then one subroutine which crafts a subroutine based on r1-r6), so i thought i'd post about it now
Title: Re: 4-level grayscale sprite editor
Post by: Downsider on November 27, 2010, 09:02:34 pm
wow  :D
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on November 28, 2010, 12:40:18 am
Umm...I'm using this and it doesn't put anything in Str1...the key is [clear] right?
Was there an update or something?
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 28, 2010, 12:43:07 am
hmm.. what calculator/OS?
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on November 28, 2010, 12:51:29 am
84PBE, 2.43, with omnicalc and calcutil installed.
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 28, 2010, 12:55:28 am
hmm... i'm not sure why it doesn't work on your calculator. there was no update or anything
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on November 28, 2010, 12:59:07 am
Well, my calculator's been kind of screwed up lately...
I'd have 10 apps on it, ~50000 archive free...
I'd put another 1-page app on it and stuff screws up and it says zero archive left.
On an 84...
It's probably just my calc being odd again :(
Title: Re: 4-level grayscale sprite editor
Post by: Deep Toaster on November 28, 2010, 01:02:59 am
Well, my calculator's been kind of screwed up lately...
I'd have 10 apps on it, ~50000 archive free...
I'd put another 1-page app on it and stuff screws up and it says zero archive left.
On an 84...
It's probably just my calc being odd again :(

O.o Tried RAM clearing? That sounds pretty messed up. How long was it like that?
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on November 28, 2010, 01:06:38 am
Months, now...I've been through countless RAM clears...
Title: Re: 4-level grayscale sprite editor
Post by: squidgetx on November 28, 2010, 09:40:12 am
Garbage collect/defrag in order?
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on November 28, 2010, 01:54:05 pm
Defrag on a calc?
I thought that was what a garbage collect did...
In any case, sometimes I've had an obscene amount of garbage collects, one for every hour or so.

Isn't defrag a PC term?
Title: Re: 4-level grayscale sprite editor
Post by: squidgetx on November 28, 2010, 02:28:53 pm
Defrag=garbage collect except for App pages. Same process, different area of memory. Occurs automatically whenever you delete an app
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 28, 2010, 03:31:36 pm
alright, so i decided i'm actually going to do something with this. first thing is i need suggestions on the in-editor menu. it'll look, generally, as the attached picture. hopefully it's intuitive enough. you select an option, and a submenu comes up (that's what the dashes indicate). note that under the File tab, after you select New or Open and a size, the Monochrome, 3Lvl Gray, 4Lvl Gray and Masked submenu is implied. anyway, what are some suggestions for it? for example, for the Turn menu should i have it be Clockwise and CC, or Right and Left? i'm leaning to Right and Left because CC is too short but Counterclockwise is too long.
I like the menu layout so far. One thing, though, for the first one, would it be best to split it in half, if it uses F1? Because I wonder if it will be hard to implement scrolling in it with that many options?

Also I like the options so far. Sounds really promising :)
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 28, 2010, 03:35:06 pm
yes, the first one will use F1. the way it's set up is this. you choose an option from New, Open, Save, Quit. say you select Open. it will open a new menu to the right of the first one (like a computer does), and say 8x8, 16x16, 8x8 Set, 16x16 Set. once you select one, it will open a third and final menu which will contain Monochrome, 3Lvl Gray, 4Lvl Gray, and Masked. after you select that, it'll show all of the sprites with that type currently saved, and you can select one to edit.
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 28, 2010, 03:40:17 pm
Ah ok, will you be able to fit everything in the screen?
Title: Re: 4-level grayscale sprite editor
Post by: nemo on November 28, 2010, 03:51:20 pm
just experimented a little, and no. but if i change Monochrome to B/W and move the menus up a little bit, then yes it'll fit on screen
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on November 28, 2010, 03:56:25 pm
Ah ok. Anyway good luck with this project and I hope you can manage to keep it small so it can easily be used for developing large games too :D
Title: Re: 4-level grayscale sprite editor
Post by: Mohammad on December 07, 2010, 06:18:14 pm
 :-\ sorry this may sound really stupid...but i want to use grayscale in my game that i am making and i cannot figure it out. i downloaded this program but how do i implement two sprites into one pt mask command(should i even use pt-mask?)?
 the app provides two sprites after i press clear. i assume one for the front buffer and one for the back...
 how do i put both into one sprite? i am confused about pt-mask also...
can someone please give an example of how you would use this program??
Title: Re: 4-level grayscale sprite editor
Post by: nemo on December 07, 2010, 06:26:35 pm
Pt-Mask isn't for four level grayscale. you get output from my program. here's what would display the sprite:
Code: [Select]
/*my program's output*/->Pic1
Repeat getKey(15)
Pt-On(0,0,Pic1)
Pt-On(0,0,Pic1)r
DispGraphrr
End
Title: Re: 4-level grayscale sprite editor
Post by: Mohammad on December 07, 2010, 06:32:53 pm
Pt-Mask isn't for four level grayscale. you get output from my program. here's what would display the sprite:
Code: [Select]
/*my program's output*/->Pic1
Repeat getKey(15)
Pt-On(0,0,Pic1)
Pt-On(0,0,Pic1)r
DispGraphrr
End
thnk you so very much!
is "my programs output" like this:

:[hex]->pic1
:[hex2]

or this

:[hex][hex2]->pic1

or this?

:[hexhex2]->pic1
Title: Re: 4-level grayscale sprite editor
Post by: nemo on December 07, 2010, 06:35:46 pm
pt-mask if for when you want to mask sprites. my editor does not output the data to do this. standard level grayscale works like this. you have a buffer pixel and a back buffer pixel. together, they determine what shade of gray is displayed. imagine the first pixels i the buffer and the second is the back buffer. 00 is white, 01 is light gray, 10 is dark gray, 11 is black. in pt mask, 00 is transparent (whatever is behind the sprite is shown), 01 is white, 10 is gray, 11 is black.
Title: Re: 4-level grayscale sprite editor
Post by: Mohammad on December 07, 2010, 06:38:15 pm
pt-mask if for when you want to mask sprites. my editor does not output the data to do this. standard level grayscale works like this. you have a buffer pixel and a back buffer pixel. together, they determine what shade of gray is displayed. imagine the first pixels i the buffer and the second is the back buffer. 00 is white, 01 is light gray, 10 is dark gray, 11 is black. in pt mask, 00 is transparent (whatever is behind the sprite is shown), 01 is white, 10 is gray, 11 is black.
ty again :)
Title: Re: 4-level grayscale sprite editor
Post by: Darl181 on December 07, 2010, 07:02:14 pm
OK, after I re-sent the OS it works now./me likes
Title: Re: 4-level grayscale sprite editor
Post by: DJ Omnimaga on December 08, 2010, 02:52:04 am
Heya Mohammad, welcome on the forums. Good luck with Axe programming and I hope you enjoy your stay! :)