Jump to content
IGNORED

Sprite Palette Indices and Sprite Data (C programming)


lghh_4

Recommended Posts

I’ve followed the Lynx.net tutorials on basic sprites and advanced sprites (and am able to compile and show a sprite) but I’m missing the connection between the indices for the sprite pallet and how those indices match up to the values in a packed or unpacked sprite array either in the C code or in a SPRPRCK .spr file. I cannot make heads or tales out of the values in the sprite data.

 

 

How do the indices for the sprite pallet match up to the data in the sprite grid?

 

 

I've attached a picture to help illustrate my question.

 

 

 

Thank you for any help!

 

Also, Thank you Lynx.net for the amazing tutorials!

post-46784-0-86357600-1522775076_thumb.png

Edited by lghh_4
Link to comment
Share on other sites

Hi Vince, it appears there is a 0 byte end-of-line marker already. Do you mean pad each line with a zero byte or blank pixel just before the end-of-line marker?

No. It is good as is.

 

Remember : the line size must count itself.

Link to comment
Share on other sites

Beware, last nible of each line must be zero-ed. To be sure, I recommend to end each line by a 0 byte.

 

The sprite packer does this for you. No worry.

 

BTW: The (original) sprite-packer allows to draw sprites as ASCII file (SPS named):

 

0000A0000

020A1A020

02A111A20

0AAAAAA0

000111000

Link to comment
Share on other sites

Hi Vince, it appears there is a 0 byte end-of-line marker already. Do you mean pad each line with a zero byte or blank pixel just before the end-of-line marker?

 

No padding needed if you use sprpck.

 

If you play around with sprites, also look at the "action" point. The sprite's x/y coordinates define it. A space ship would have in the middle of the top, a ball in the middle.

Without setting it (-axxxyyy) it is the left/upper pixel. But for your space ship I would use -a003000.

The action point is also important for tilting/stretching.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...