Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: ACagliano on August 30, 2010, 12:37:08 pm
-
Can someone explain to me how to use the Bitmap command. I get the bitmap(x,y... part. X means x and Y means y. But what about the actual map? How should a filled 6x6 sprite look for that command?
-
What you do is use the Data() command and make it so that 6x6 is your width and height.
Then, write your data after that.
Then, Bitmap that Pointer.
-
But what I'm asking is how should the data look. What would the "rows of that image" look like?
-
:.BLAH
:Data(6,1->GDB1
:[FFFFFFFFFFFF
:ClrDraw
:Bitmap(1,1,GDB1
-
Data(rowsInImage , columnsInImage)->Pic1 .columnsInImage must be a multiple of eight!
[[HEX]]
Bitmap(X,Y,Pic1)
-
Actually, you can define the first two bytes of the sprite as the size.
.BITMAP
[181000000070009803641E6430127FD254B1192919251035F1DE5E242528DCD6B7F54C5B3ECE1DFC23664E32D42BF81F0000→Pic1
Bitmap(X,Y,Pic1)
The first two bytes are hexadecimal for the height and the width of what you want to display in that order.
The width that you define does not have to be a multiple of 8, but you do have to pad all the rows in your bitmap to the nearest byte.
Be aware that if you use bitmaps in an App, you'll have to copy the bitmap you want to display to saferam or an appvar, then use a pointer to that location to display it.
.Bitmap
[181000000070009803641E6430127FD254B1192919251035F1DE5E242528DCD6B7F54C5B3ECE1DFC23664E32D42BF81F0000→Pic1
"appvBITMAP→Str1
GetCalc(Str1,50)→P
Bitmap(X,Y,P)
The examples I posted will display a 16x24 sprite at X,Y.
-
can't you read from Archive with Axe? Or is this because of Bitmap is an OS ROMcall, which isn't fully converted to Axe command (jet)?
-
Thank you both. I'll play around an see what I can do.
-
If you draw sprites from archive, you will need to follow a few steps. First have a small reserved place in ram for a very small and very temporary storage such as L5. Use the copy command to copy the sprite's data to that temporary buffer. Draw the sprite using that buffer as an argument instead of the file. You should turn this into a subroutine that does both of these things for you automatically so you only need a single call to draw the sprite. The exact same procedure should be used with apps as well. If you're drawing the same sprite multiple times, you can optimize by only copying once and then drawing every instance of that sprite before copying the next sprite to be drawn.