Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sprite not showing

Author
Message
luka85
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location:
Posted: 10th Nov 2015 03:06
Hi: just wondering if I could get some help, I have just started using DBPro and am having difficulties with a piece of code. My sprite isn't showing up the background image is and the background is set to 0 and the sprite is set to 1
[SET DISPLAY MODE 640, 480, 32
HIDE MOUSE
cls
`load the background bitmap
load bitmap "background.bmp", 0
`Load the source bitmap file
LOAD BITMAP "F15.bmp", 1
`Grab image 1 from bitmap
GET IMAGE 1,0,0,300,300
`Draw the sprite
SPRITE 1,170,90,1
paste sprite 1, 0, 0
`Wait for keypress
WAIT KEY
END]
No idea if I did the code snippet right or not sorry, any help would be highly appreciated
luskos
16
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 10th Nov 2015 12:19
What are you trying to do ? Your code is complete mess and i can not understand what are your intents.
You must know that "LOAD BITMAP" is different from "LOAD IMAGE", which you probably want to use in this case.
You load image, sprite it on the screen and then you can modify it - rotate, move, create animated sprite, play it, etc.
Also you may want to use other file formats than bmp, it's heavy on resources.
Coding is My Kung Fu!
And My Kung Fu is better than Yours!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Nov 2015 16:16
When you load or create a Bitmap it becomes the active surface to which all drawing will be directed. After you load F15.bmp and grab the image you need to Set Current Bitmap 0.
luka85
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location:
Posted: 11th Nov 2015 00:11
Thanks for the help got it figured

Login to post a reply

Server time is: 2024-04-23 15:35:08
Your offset time is: 2024-04-23 15:35:08