Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Munchor on November 21, 2010, 03:13:43 pm
-
Hey, I was trying to implement an image in my programs, a 16*16 image, this is the code:
00000000000000000000000003F80404080410027FFF8001FFFF781E4812300C
So I would have:
Lbl 1
[00000000000000000000000003F80404080410027FFF8001FFFF781E4812300C->Pic1
Pt-Change(0,0,Pic1
DispGraph
Repeat getKey->Z
If Z>=1
Goto1
However, nothing appears, is it a temporary problem or it works for you?
I gotta try it in WabbitEmu but I can't now :S
-
Pt-Change takes a pointer to an 8-byte sprite. a 16x16 image is 32 bytes. you'll need to do this:
Lbl 1
[00000000000000000000000003F80404080410027FFF8001FFFF781E4812300C->Pic1
Pt-Change(0,0,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,8,Pic1+24
DispGraph
Repeat getKey->Z
If Z>=1
Goto1
-
Pt-Change(0,0,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,8,Pic1+24
Wuuuh thanks much! Like your reply ;)
-
Pt-Change(0,0,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,8,Pic1+24
Wuuuh thanks much! Like your reply ;)
Optimization ;)
Pt-Change(0,,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,,Pic1+24
-
Pt-Change(0,0,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,8,Pic1+24
Didn't work :S
Pt-Change(0,,Pic1
Pt-Change(8,0,Pic1+8
Pt-Change(0,8,Pic1+16
Pt-Change(8,,Pic1+24
Nice optimization, gotta try it too :)
-
Also, I'm a little confused as to what you intended your getKey code section to do. The Repeat doesn't have a matching End, and it doesn't make sense to have code to check a getKey value inside of a loop that will end whenever you press a key.
-
Also, I'm a little confused as to what you intended your getKey code section to do. The Repeat doesn't have a matching End, and it doesn't make sense to have code to check a getKey value inside of a loop that will end whenever you press a key.
What doesn't work is the image :S It is all confused and crazy :s
And I'm using Pause 9999
-
That's because your image is a 16x16 sprite. What you need to do is split it into four 8x8 sprites, and it should work.
-
And I'm using Pause 9999
Just a note, there's no reason to stop at 4 digits. You know you can pause for values up to 65535 (actually up to 65536, which is what 0 does)
-
For odd reasons, I think he ended up taking a habit from BASIC programming. ;D. In BASIC, it's typical to do Repeat Z=number:Getkey->Z:End in non-realtime games, because otherwise, at 2-3 FPS, key detection is terrible.
-
Sorry, had to go earlier, but what I meant by
That's because your image is a 16x16 sprite. What you need to do is split it into four 8x8 sprites, and it should work.
is this: Say you have a picture like this:
■■■■■■■■■■■■■■■■
■■▢▢▢▢▢▢▢▢▢▢▢▢■■
■▢■▢▢▢▢▢▢▢▢▢▢■▢■
■▢▢■▢▢▢▢▢▢▢▢■▢▢■
■▢▢▢■▢▢▢▢▢▢■▢▢▢■
■▢▢▢▢■▢▢▢▢■▢▢▢▢■
■▢▢▢▢▢■▢▢■▢▢▢▢▢■
■▢▢▢▢▢▢■■▢▢▢▢▢▢■
■▢▢▢▢▢▢■■▢▢▢▢▢▢■
■▢▢▢▢▢■▢▢■▢▢▢▢▢■
■▢▢▢▢■▢▢▢▢■▢▢▢▢■
■▢▢▢■▢▢▢▢▢▢■▢▢▢■
■▢▢■▢▢▢▢▢▢▢▢■▢▢■
■▢■▢▢▢▢▢▢▢▢▢▢■▢■
■■▢▢▢▢▢▢▢▢▢▢▢▢■■
■■■■■■■■■■■■■■■■
Instead of storing it as a 16x16 picture, as in
:[FFFFC003A0059009881184218241818181818241842188119009A005C003FFFF]→Pic1
you should think of it as four 8x8 pictures:
■■■■■■■■ ■■■■■■■■
■■▢▢▢▢▢▢ ▢▢▢▢▢▢■■
■▢■▢▢▢▢▢ ▢▢▢▢▢■▢■
■▢▢■▢▢▢▢ ▢▢▢▢■▢▢■
■▢▢▢■▢▢▢ ▢▢▢■▢▢▢■
■▢▢▢▢■▢▢ ▢▢■▢▢▢▢■
■▢▢▢▢▢■▢ ▢■▢▢▢▢▢■
■▢▢▢▢▢▢■ ■▢▢▢▢▢▢■
■▢▢▢▢▢▢■ ■▢▢▢▢▢▢■
■▢▢▢▢▢■▢ ▢■▢▢▢▢▢■
■▢▢▢▢■▢▢ ▢▢■▢▢▢▢■
■▢▢▢■▢▢▢ ▢▢▢■▢▢▢■
■▢▢■▢▢▢▢ ▢▢▢▢■▢▢■
■▢■▢▢▢▢▢ ▢▢▢▢▢■▢■
■■▢▢▢▢▢▢ ▢▢▢▢▢▢■■
■■■■■■■■ ■■■■■■■■
Then you'd store each 8x8 chunk one by one, starting with the top left, then top right, then bottom left and right. So you'd store it as
:[FFC0A09088848281]→Pic1
:[FF03050911214181]
:[8182848890A0C0FF]
:[81412111090503FF]
which is basically the four 8x8 sprites one after another, and it should work.
-
Sorry, had to go earlier, but what I meant by
That's because your image is a 16x16 sprite. What you need to do is split it into four 8x8 sprites, and it should work.
is this: Say you have a picture like this:
■■■■■■■■■■■■■■■■
■■▢▢▢▢▢▢▢▢▢▢▢▢■■
■▢■▢▢▢▢▢▢▢▢▢▢■▢■
■▢▢■▢▢▢▢▢▢▢▢■▢▢■
■▢▢▢■▢▢▢▢▢▢■▢▢▢■
■▢▢▢▢■▢▢▢▢■▢▢▢▢■
■▢▢▢▢▢■▢▢■▢▢▢▢▢■
■▢▢▢▢▢▢■■▢▢▢▢▢▢■
■▢▢▢▢▢▢■■▢▢▢▢▢▢■
■▢▢▢▢▢■▢▢■▢▢▢▢▢■
■▢▢▢▢■▢▢▢▢■▢▢▢▢■
■▢▢▢■▢▢▢▢▢▢■▢▢▢■
■▢▢■▢▢▢▢▢▢▢▢■▢▢■
■▢■▢▢▢▢▢▢▢▢▢▢■▢■
■■▢▢▢▢▢▢▢▢▢▢▢▢■■
■■■■■■■■■■■■■■■■
Instead of storing it as a 16x16 picture, as in
:[FFFFC003A0059009881184218241818181818241842188119009A005C003FFFF]→Pic1
you should think of it as four 8x8 pictures:
■■■■■■■■ ■■■■■■■■
■■▢▢▢▢▢▢ ▢▢▢▢▢▢■■
■▢■▢▢▢▢▢ ▢▢▢▢▢■▢■
■▢▢■▢▢▢▢ ▢▢▢▢■▢▢■
■▢▢▢■▢▢▢ ▢▢▢■▢▢▢■
■▢▢▢▢■▢▢ ▢▢■▢▢▢▢■
■▢▢▢▢▢■▢ ▢■▢▢▢▢▢■
■▢▢▢▢▢▢■ ■▢▢▢▢▢▢■
■▢▢▢▢▢▢■ ■▢▢▢▢▢▢■
■▢▢▢▢▢■▢ ▢■▢▢▢▢▢■
■▢▢▢▢■▢▢ ▢▢■▢▢▢▢■
■▢▢▢■▢▢▢ ▢▢▢■▢▢▢■
■▢▢■▢▢▢▢ ▢▢▢▢■▢▢■
■▢■▢▢▢▢▢ ▢▢▢▢▢■▢■
■■▢▢▢▢▢▢ ▢▢▢▢▢▢■■
■■■■■■■■ ■■■■■■■■
Then you'd store each 8x8 chunk one by one, starting with the top left, then top right, then bottom left and right. So you'd store it as
:[FFC0A09088848281]→Pic1
:[FF03050911214181]
:[8182848890A0C0FF]
:[81412111090503FF]
which is basically the four 8x8 sprites one after another, and it should work.
Ooooh thanks, then I gotta split my image, it won't be hard using tokens :)