Jump to content
IGNORED

question sprite size


Recommended Posts

Hello,

 

Is it possible for example to create a sprite 200x200 pixels and then display just a part of that data on the screen.

 

So picture (sprite) 200x200 then set x,y,width,heigh to display only that part from the full picture.

 

Maybe we need a second sprite that has the x,y,witdh,heigh dimensions, and copy the data needed from the 200x200 picture to that one and disable the 200x200 sprite and display the small one but we haven't figured out how-to in Raptor Basic+

 

 

 

 

Link to comment
Share on other sites

RAPTOR API can do this, not sure about RB+. You would have to manually define the object in the list and not use the auto-builder.

 

Grab the RAPTOR manual (**NOT the RB+ Manual**) and look up Raptor List Data (Page 63) - specifically: _width, _height, _gwidth and _gfxbase (which, mysteriously isn't documented, but points to the bitmap - LOL)

Edited by CyranoJ
  • Like 2
Link to comment
Share on other sites

Never actually used it (because I've not had any reason to) but the last line of each object definition in rapinit.s is R_sprite_gwidth:


dc.l 352/2 ; ; Width of sprite within larger graphic. ; R_sprite_gwidth

; Enter the x-size and add the following:

; /8 for 1bit

; /4 for 2bit

; /2 for 4bit

; nothing for 8bit

; *2 for 16bit

; *4 for 24bit


Normally this would be the full width of your object for a regular object, but when using a narrower section of a larger bitmap reduce that to what you need (respecting the usual size conventions(?). The above should take care of the object's width, set R_sprite_gfxbase to an offset into your larger bitmap (BIGPIC+offset) if you don't want it to start from the top left. Object width should be set to that of the original BIGPIC bitmap itself and height should be only the height in pixels you wish to use from the larger graphic I'd guess...?


It's a suck it and see kind of thing :0) Let us know how you get on.


Also, what's the reason for wanting to do this? I've never understood why you'd want to other than for some cheeky "free" fx maybe.

Edited by sh3-rg
  • Like 1
Link to comment
Share on other sites

Hello,

 

Thanx for the info.

 

We just loaded the bigger bitmap showing it smaller does work but I need to manipulate the R_sprite_gfxbase but that's the only thing that can not be accessed by RB+ yet. Will check with ggn if he can add that in a next release.

Link to comment
Share on other sites

We just loaded the bigger bitmap showing it smaller does work but I need to manipulate the R_sprite_gfxbase but that's the only thing that can not be accessed by RB+ yet. Will check with ggn if he can add that in a next release.

 

R_sprite_gfxbase modification is shown in my tutorial #2.

Link to comment
Share on other sites

Yes just wanted to post that (you're faster then me) I thought I read it somewhere :-) I was mislead by the comment in rapinit.s it has a * for every label that could be accessed by RB+ but that was changed ...

 

No problem, there's a few issues like that, newer things get added or things altered and it's a minefield remembering to update all previous uses... and the current approach to tackling that seems to be along the lines of "meh, whatevs, life's too short" :0)

Link to comment
Share on other sites

I'd like to add that everything inside raptor.h and rbasic.h is exposed to rb+. So you more or less have access to all hardware registers, as well as raptor's structures.

 

IIRC it's just that raptor itself might not like you redefining some of those properties on the fly, so if you're going to dig that deep, prepare to get stranded down there :0)

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...