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! / Sprites and Images

Author
Message
MoldRat
20
Years of Service
User Offline
Joined: 3rd Jan 2004
Location: localhost
Posted: 4th Jan 2004 11:33
How do I make A sprite? Do I create it from an image? I have some images I need to turn into sprites.

http://www.dn3k.net/ - 12oz Soda
Theres no place like 127.0.0.1
Damokles
20
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 4th Jan 2004 11:39 Edited at: 4th Jan 2004 11:41
That's how :
You load the image and you turn it into a sprite with these commands :

And don't forget to put

at the end of your program

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
MoldRat
20
Years of Service
User Offline
Joined: 3rd Jan 2004
Location: localhost
Posted: 4th Jan 2004 14:02
Ok, It was right there in the manual but I was too drunk to comprehend it. Sorry.

http://www.dn3k.net/ - 12oz Soda
Theres no place like 127.0.0.1
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 4th Jan 2004 19:15 Edited at: 4th Jan 2004 19:15
When loading/getting images for sprites, it might be a good idea to set the optional Texture Flag at the end to 1

Load Image <filename>, <image number>, <texture flag>
Get Image <image number>, left, top, right, bottom, <texture flag>

...otherwise your sprites might come out a bit blury and the wrong size.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
GuruSY
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location:
Posted: 25th Jan 2004 20:09
Wait a minute... Damakoles, why do you have to delete them at the end of the program? I'm a newb, but I thought that DB handles memory clean up at the end.

Thanks!
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 25th Jan 2004 21:17
You don't db should do it all for you.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 27th Jan 2004 20:53
You still have to delete you memory, DB doesn't handle it for you. I think it's more a winxp handleing then DB you can crash a win 98 or me computer by not clearing the memory you use before you exit. You can create a program that uses alot of memory items and run it repeatly over and over, and watch the system resources drop. So, it's a good idea to do proper clean up at the end of the program.

RGT may be gone but the best DBP forum is still alive and kicking, check it out.
http://www.dannywartnaby.co.uk/rgt/
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Jan 2004 22:23
Can you show me how to do a clean up with the Esc key?

Pincho.

zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 28th Jan 2004 00:01
The key to that is to disable the escape key and then capture it via its scancode. Then, you can call your clean up code and exit the program.
--
TAZ

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 28th Jan 2004 13:11
Ok sounds good!

Login to post a reply

Server time is: 2024-05-13 04:33:59
Your offset time is: 2024-05-13 04:33:59