Anybody know how attributes work? I just want to mirror a sprite, but all I see in the reference is that I need to use an attribute, something about ¦b03¦ and #SOMETHING. I can't figure out how to use it...
The value is binary. The different bits in the binary number mean different things. The # things are system constants. They're pretty much just variables.
The first bit is visibility, and can be represented with 1 or #SPSHOW.
The one that horizontally flips it is 8 and has a system constant of #SPREVH.
You'd want (#SPREVH OR #SPSHOW). If you want to do it in decimal, that would be 9.
The 1 was for #SPSHOW, without it the sprite is invisible. Now I've tried creating two seperate commands, SPSET with the #SPSHOW attribute, and SPDEF with the #SPREVH attribute. Now, while the sprite shows, and there are no errors, it still isn't mirrored... I don't understand why some of these things have been made so much more complicated from PTC...
Hold up, I got it! I used SPCHR instead of SPDEF, and it works fine now! That said, there has to be a way to add multiple attributes to a sprite in one command, right? If there's a simpler way to do this, please let me know!
As a previous post mentioned, the number you enter is referenced via binary. The b's you see next to the numbers reference these bits and look like this:
Bit 03 Bit 02 Bit 01 Bit00
0 0 0 0
I don't know the attributes by heart yet, so i'll use an example.
Let's say bits 0-1 controlled rotation. 0:0 , 1:90 , 2:180 , 3:270. Because of how attribute works, you >>
have two options: you can either put in a normal number or its binary equivalent.
In the example I provided, if I wanted to rotate it by 270 degrees, the corresponding but values would be
( bit01: 1 bit00: 1 ) or the number 3.
Now, if you wish to use the first method, the number you use needs to be in binary format, with " &B ". The number also needs to be as big as number of bits.
In the pic, I used SPDEF, but the same principle applies.
Notice what I typed at the end:
" &B010001 "
With the aide of the binary format, each individual number represents a bit:
0 1 0 0 0 1
Bits: 05 04 03 02 01 00
With this, you can apply a 1 to whatever you want to be true. In this case, I told it to show the sprite and invert it vertically.
Like so:
Alternatively, I could've simply typed in the numerical equivalent of (0)10001, which is 17, at the end to get the same result.
However, I find it easier to manage when actually looking at the bits.
Hope this helps somewhat. If not, then I tried. :p
I was stuck on this as well, but I learned how it works with the ATTR command, which messes with text on the display console. It was helpful because it used less bits.