Page 1 of 1

Posted: Mon Nov 05, 2001 2:52 am
by BackupUser
Restored from previous forum. Originally posted by cfriedel.

Hi all. I am a newbie to the PB world, so please excuse me if this question has already been answered. Am currently trying to learn how to use the screen and sprite commands. Wrote a little program to try it out (listed below) but it does not seem to work. I have also tried to compile sprite.pb (included in the help) and it does not display either. All I get is a black screen for both. Please note that I am using the registered version of 2.50. My version of DirectX is 8.0A. Thanks for any help in advance. Have a good day.

Cliff Friedel

PS - The Sprite I am using is a 24bit BMP file that is 32x32 in size.

--------------------------------------------------------------------------

If InitSprite(0)=0
MessageRequester("Error","Error: You must have DirectX7 or Better",0)
End
EndIf
If OpenScreen(640,480,24,"Sprite")
LoadSprite(0,"65.bmp",0)
DisplaySprite(0,10,10)
EndIf

Posted: Mon Nov 05, 2001 7:53 am
by BackupUser
Restored from previous forum. Originally posted by wavemaker.

Welcome cfriedel,

I think the problem is that the bmp file should be in the same directory of the executable. If you compile with F5, the temporary executable is put in /Compilers, so it doesn't find the image file. Create the executable first in your .pb file directory or copy the image file in the /Compilers directory, then it should work -sprite.pb too-.

Hope it works. Bye,

Juan Calderón Alonso
Registered user

Posted: Mon Nov 05, 2001 3:01 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.

Where is your FlipBuffers() command that actually brings everything into view??

Posted: Mon Nov 05, 2001 5:48 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
I think the problem is that the bmp file should be in the same directory of the executable. If you compile with F5, the temporary executable is put in /Compilers, so it doesn't find the image file. Create the executable first in your .pb file directory or copy the image file in the /Compilers directory, then it should work -sprite.pb too-.
There is no more such problem with new 2.60. Everything is path relative.

Fred - AlphaSND

Posted: Mon Nov 05, 2001 8:57 pm
by BackupUser
Restored from previous forum. Originally posted by cfriedel.

I will download the new version and see if that works. As for the FlipBuffers() command I tried it right after the displaysprite command. I forgot to include it when I put the code up. Thanks for the help so far. I will keep you all posted...

Posted: Mon Nov 05, 2001 10:34 pm
by BackupUser
Restored from previous forum. Originally posted by cfriedel.

The new version fixed the problem. Everything is now coming up fine. Thanks to all who helped. These forums and the PB community are really helpful.

Cliff