TXG/MNX Posted July 27, 2015 Share Posted July 27, 2015 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+ Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted July 27, 2015 Share Posted July 27, 2015 (edited) 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 July 27, 2015 by CyranoJ 2 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted July 27, 2015 Share Posted July 27, 2015 (edited) 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 July 27, 2015 by sh3-rg 1 Quote Link to comment Share on other sites More sharing options...
TXG/MNX Posted July 27, 2015 Author Share Posted July 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted July 27, 2015 Share Posted July 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
TXG/MNX Posted July 27, 2015 Author Share Posted July 27, 2015 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 ... Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted July 27, 2015 Share Posted July 27, 2015 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) Quote Link to comment Share on other sites More sharing options...
ggn Posted July 27, 2015 Share Posted July 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted July 27, 2015 Share Posted July 27, 2015 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) Quote Link to comment Share on other sites More sharing options...
TXG/MNX Posted July 27, 2015 Author Share Posted July 27, 2015 We checked we got all we need right now. Thanx I know live overrulez my Jaguar time alot aswell... Sent from UMI hammer with Tapatalk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.