grabsprite...

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

Hello folks,

I was happy because I found a way for storing all my sprites.
I have 1 bmp file with all the sprites, I draw the image (in the
off-screen) and I load all my sprites in a table with
grabsprite.

I just realized there is a f#@&! limit (I should guess before) :
if the bmp file does not fit in the window I can't grab the sprites
out of that window (of course).

Just in case I have tried grabimage(bmp, sprite,...) but it crashes
when drawing the sprite (of course it is not the same strucure).

Does anyone have an idea ??? I need to "pick" sprites from an image
without display this image before...:)

Thks a lot
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Kale.

maybe this:
Syntax

Result = ClipSprite(#Sprite, x, y, Width, Height)
Description

Add a clip zone to the specified sprite. For example, if a sprite is 100*100 (Width*Height) and a clipping zone is added as x=10, y=10, Width=20, Height=20 then when the sprite is displayed, only the rectangular area starting from x=10, y=10 with width=20 and height=20 will be displayed.
:)

--Kale

In love with PureBasic! :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Or may be by using UseBuffer(Sprite(xxx)).

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Skipsy.

clisprite was my first idea but having a HUGE sprite (about 500x1024)
seems to be a problem... and clipsprite is time consuming (maybe
because of the size ?)

It works fine using UseBuffer (). I knew this function but I didn't
realized it could be the solution...:)

Thanks all
Post Reply