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.

2D All the way! / Size!!

Author
Message
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 15th Feb 2006 02:23
ok i am using a sprite for a crosshair and when i put the code in it says the image is to small to get it can someone help me. here is the code!


Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 15th Feb 2006 04:02
Well, what size is that image your loading. Because if it is 300x300 then you have it wrong in the get image command, as it will take from 0 to 300 making so 301 pixels, so jumping to that kind of error. Check on that...
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 15th Feb 2006 04:12
how do you check? here is the crosshair.

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Feb 2006 11:28
It's better to just avoid using a bitmap and just use the "load image" command. That puts both the "load bitmap" and "get image" commands in one command.




Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Feb 2006 12:13
Yes Load Image is better. You need your images to be saved as small bmp's by using the selection box, copy paste from clipboard.

Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 15th Feb 2006 15:02
To check the width and height of the bitmap just go to paint and press "ctrl+U", there are lots of other ways thought....
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 15th Feb 2006 16:48
ok i changed the code a error doesnt come up anymore but i cant see the cross hair!
im dum

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 15th Feb 2006 22:02
First of all, the load image, shouldn't (musn't?) be within the loop, as you load the image just once. As for the rest i suppose is ok, however, if your using dbpro, add a ",1" to the load image command, because within the new version of dbpro, there some flag stuff allong with the load image and other stuff as such, which may bother in pixeled images, such as your crosshair. Try that for now
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 16th Feb 2006 05:28
even if i change it to this
it still comes out as a black screen!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 16th Feb 2006 15:02 Edited at: 16th Feb 2006 15:03
Oh, im so stupid, sorry.
I'll explain first, when you load the image, you set it to be image number 1, so, if you want to use that image, you must do reference to that number (1). If you check the sprite command, the last number is supposed to be the image number. You've put 10, however in that short code, no image is pointing to number 10. Basically you must change 10 for 1....



of course that, if you later on change the image number where you setted the image when loaded/grabed (whatever), you must also change that value, if its that image you want to show...

now i see that Grog did it ok in his code.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 16th Feb 2006 16:36 Edited at: 16th Feb 2006 16:39
You need to SYNC in order to see any changes made on screen.
Also the last parameter at the end of the sprite command is the image number. You loaded your crosshair as image number 1 but called image 10 in the sprite command.

Try this



Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 16th Feb 2006 20:28
Quote: "now i see that Grog did it ok in his code."


I should of told him about the 10 but I was in a rush... I didn't even put "wait key" in there. :-(


DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 17th Feb 2006 05:19
thank you guys you saved me!

how do you make it so that you dont see the background color of the Image because it is white and the screen is black?

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 17th Feb 2006 05:47
i put it into my FPS and it textured mt matrix here is a screeny! and here is my code!


Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/

Attachments

Login to view attachments
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 17th Feb 2006 13:37
Theres a command called "set image colorkey", which defines which color will be transparent. You must define this color before loading any images. Also you'll need to know the command "rgb" to define the color. Rgb needs 3 parameters: Red(0-255) , Green(0-255) , Blue(0-255)
Example of this:
rgb(0,0,0) -> black
rgb(255,255,255) -> white
rgb(255,0,0) -> red
rgb(0,255,0) -> green
rgb(0,0,255) -> blue

play around and you'll get diferent colors.

So basically, you must add the following before loading any images...

the command has attached to it the rgb command, so you won't need to write "rgb()" and so...
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 17th Feb 2006 16:47
i put the code in right before were i load the crosshair and it said that it was an unknown command!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 17th Feb 2006 19:07
Can you show us the code?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Feb 2006 20:05
It's because "set image colorkey" is only available in Pro. Even if you were using Pro it's easier to just load that graphic in a drawing program and change the white to black (which is the default color for transparent).

I attached your crosshair with a black background to this message.


Attachments

Login to view attachments
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 01:41
oh how do you do it in classic here is my code!


Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 18th Feb 2006 04:18
ok never mind guys i gto it working! thank you alot you guys are asome!

Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/

Login to post a reply

Server time is: 2025-05-16 14:50:41
Your offset time is: 2025-05-16 14:50:41