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 / 2d sprite help

Author
Message
Triple Ha
20
Years of Service
User Offline
Joined: 18th Apr 2004
Location: California, but I wish I was in Japan
Posted: 17th May 2004 06:56 Edited at: 17th May 2004 06:58
I get the get image part and sprite function, but can't get my sprite on the screen. Would anyone be so kind as to tell me what is wrong with this?

load image "example.bmp",1
load image 1,2,3,4,5
sprite 1,x,y,1

It's in DBC, FYI.

If interested in making games go to http://www.freewebs.com/abutton...NOW!
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 19th May 2004 00:48
Hi,

Not sure what you're doing on the second line, and you haven't set x/y to anything. Try this...

load image "example.bmp",1
do
sprite 1,50,50,1
sync
loop

I did see something a while back where if the image was invalid the sprite would appear so tiny you couldn't see it, so also check that your image is valid.

Hope it helps,
Cheers.
SkyeFyre
20
Years of Service
User Offline
Joined: 18th May 2004
Location: Ontario, Canada
Posted: 19th May 2004 01:03
Hello. I'm having the same problem with my Dark Basic Pro
I have tried several different pictures and none seem to display on my screen. I just keep getting a black screen. I cannot get any sprites to work. I also tried putting a PRINT command in before and after the SPRITE command to see if I could get text and I cannot even get that. Not until I remove all other commands, I can't even have the LOAD BITMAP in there or else the text will not display. I don't know what's wrong.

Any help on this would be greatly appriciated.
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 19th May 2004 01:35 Edited at: 19th May 2004 01:36
Hi,

@SkyeFyre, looking at your code, you are replacing your loaded image with a captured blank area of the screen -



You don't need to do the GET IMAGE command. Remove it, add a sync and it'll work -



You only need the GET IMAGE command if you want to capture an area of the screen, for example...



EDIT:Actually, in my examples above, you don't need the Sync, but I put it there just to be sure the screen was updated

Hope it helps,
Cheers.
SkyeFyre
20
Years of Service
User Offline
Joined: 18th May 2004
Location: Ontario, Canada
Posted: 19th May 2004 02:01 Edited at: 19th May 2004 02:10
Hey cool thanks.
/me looks at his Premier's Beginners Guide To Programming using Dark Basic
-_-...figures... stupid book

Um... just tried that still won't work. =/ I don't know what's up

EDIT:It works when I do LOAD IMAGE... but not LOAD BITMAP. Now, with this I get a blue background so I'm guessing that means I'm in 3D mode. I want do to a 2D game, can it be done with LOAD IMAGE? or do I need to keep tearing my hair out trying to figure out how to use LOAD BITMAP?
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th May 2004 03:03 Edited at: 19th May 2004 03:06
You proberly want to do this.



LOAD IMAGE loads directly into an image. Also if you are using dbpro and the image for 2d it's best to use the GET/LOAD IMAGE texture flag so dbpro doesn't filter the image lowering the quality e.g
load image "a.bmp",1,1
get image 1,0,0,50,50,1

[beat the machine that works in your head]
SkyeFyre
20
Years of Service
User Offline
Joined: 18th May 2004
Location: Ontario, Canada
Posted: 19th May 2004 04:20
I tried that and I keep getting an error saying

#100008: Parameter for 'LOAD IMAGE' do not match 'Filename, Image Number' at line 1.
Triple Ha
20
Years of Service
User Offline
Joined: 18th Apr 2004
Location: California, but I wish I was in Japan
Posted: 19th May 2004 05:00
My problem is in DB CLassic, as I stated before.

If interested in making games go to http://www.freewebs.com/abutton...NOW!
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 19th May 2004 05:08
If your using dbc just remove the texture flag e.g.



[beat the machine that works in your head]

Login to post a reply

Server time is: 2024-11-26 18:34:04
Your offset time is: 2024-11-26 18:34:04