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 / difference between a sprite and an image?

Author
Message
fatbiffa
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location:
Posted: 29th Sep 2005 15:22
is one fater to draw? what's the difference?

heart of gold, nerves of steel, nob of butter
Deep Thought 42
19
Years of Service
User Offline
Joined: 31st Jul 2005
Location: New Jersey, USA
Posted: 29th Sep 2005 15:59
An image and a sprite have many differences. Images can be pasted on to sprites if you want to move it around. Example: You paste a crosshair image on a sprite to act as an aiming device. Check out the commands list for the different things you can do with sprites and images. As for the speed, I have noticed no difference.

"Winners never quit and quitters never win. But those who never win and never quit are idiots."
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Sep 2005 16:15
Essentially, sprites are images, but with extra associated features to make 2D games easier to write - like collision and the ability to restore the screen below them when they are moved.

You can't do this with images, though with a bit of extra code, you can do more or less anything you can do with sprites, but with images. But, if you are writing a 2D game it makes more sense to use sprites.

In 3D I think it makes more use to use images for everything rather than sprites IF YOU DON'T NEED COLLISION as 3D redraws the screen with the Sync command anyway. Sprites were not actually intended to be used in 3D, but they can be.

In a nutshell, it doesn't matter which you use as long as it works and it looks right!

TDK_Man

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Sep 2005 16:29
There are a lot of advantages of using sprites, as long as the performance is acceptable for your game. For 90% of people, it will be fine.

Transparency. you can use alpha transparency. Pasted Images only have colour key transparency (pick a colour and all pixels of that colour are 100% transparent)

They look after their own repainting. That is, you can move them, and it repaints whatever was underneath automatically.

More properties available, such as height, width etc.

You can rotate, mirror, stretch and squash sprites.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Sep 2005 17:23
BatVink is correct.

I didn't list any other differences because you didn't say if you were using DBC or DBP and like Rotate Sprite, some commands are only available in DBPro.

TDK_Man

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Sep 2005 19:10
My bad...I was wrong on this point...

Quote: "Transparency. you can use alpha transparency. Pasted Images only have colour key transparency (pick a colour and all pixels of that colour are 100% transparent)"


This is untrue, I was unfair to images. It was my bad programming that made me think this. I am not worthy.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Sep 2005 19:21
A sprite is apparently an object just slapped onto the screen


Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 29th Sep 2005 21:22
Quote: "This is untrue"

you can make images partly transparent????

"We make the worst games in the universe."

Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 29th Sep 2005 22:03
Quote: "A sprite is apparently an object just slapped onto the screen"


LOL - you baffling us with technical jargon.


The word "Gullible" cannot be found in any English Dictionary.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 30th Sep 2005 03:01
Sprites are the best thing since sliced bread. All the old fogies on here (including me) that used Quickbasic all know how how fun it was to make our own "sprite" functions.

If you don't have Pro you're missing out on all the cool sprite commands.

Login to post a reply

Server time is: 2024-11-13 21:10:19
Your offset time is: 2024-11-13 21:10:19