Author Topic: Drawing a picture  (Read 3166 times)

0 Members and 1 Guest are viewing this topic.

Offline lennyitb

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Drawing a picture
« on: July 24, 2014, 07:13:00 pm »
I have been working at figuring out and researching how to draw a picture larger than 8x8 in axe, for example this one:
Spoiler For Spoiler:
FFFFF000015066152221752205622254225537720000044011549935555528913800008244582AA582CA39A80982615F80D4
which by the way is 20x20. What I've been doing is this:
Code: [Select]
:[(picture)]->Pic1
:Pt-On(1,1,Pic1)
:0->K
:While K=0
:getKey->K
:End
:Return
And if it wasn't clear, (picture) is to be replaced with the actual picture. So what have I been doing wrong? -Lennyitb
-Yours Truly,
lennyitb

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Drawing a picture
« Reply #1 on: July 24, 2014, 07:28:21 pm »
The simple way is to draw it using the Bitmap() command, for which you specify the specify the sprite's dimensions by putting its width (1 byte) followed by its height (1 byte) at the start of the sprite data. You can either insert these at the start of the hexadecimal sprite data (in hexadecimal), or if you want to enter the size in decimal numbers, the following would be equivalent:

Code: [Select]
Data(20,20)→Pic1
[(picture)]

Note that each row of image data must be padded on the end with zero bits such that each row takes up a whole number of bytes; in the case of a width of 20, each row should consume ceil(20/8) = 3 bytes. It doesn't seem like your data follows this, so you'd need to amend it.

Offline lennyitb

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: Drawing a picture
« Reply #2 on: July 24, 2014, 09:26:47 pm »
Wow thanks man! This calls for emoticons!
 :angel: :w00t: *.* :hyper: :thumbsup:
-Yours Truly,
lennyitb