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.

Dark GDK / ID for every single sprite necessary?

Author
Message
InsanitY
15
Years of Service
User Offline
Joined: 6th Aug 2009
Location: The Netherlands
Posted: 6th Aug 2009 13:49
Hi,

Is it really necessary to give every single sprite an ID? Even if I, for example, have 100 sprites with he same image that I use as a background. Do I need to have spriteID 1 - 100, or is it somehow possible to make something like a groupID, so I can say something like

?

Because having (in this example) 100 unique sprites that have the same image is kind of inconvenient.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 6th Aug 2009 17:53
use dbPasteSprite()?

InsanitY
15
Years of Service
User Offline
Joined: 6th Aug 2009
Location: The Netherlands
Posted: 6th Aug 2009 18:37
I tried, but it didn't work.. can you please give a code example, maybe I did something wrong :/
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 6th Aug 2009 19:07
Sprites are more than image holders. They also do housekeeping on where the sprite is located, what orientation it has, what the scale is, etc. If you don't have a sprite to hold that information then you'd have to maintain that information yourself and take care of pasting it to the screen. Using a sprite, along with its ID, allows the system to take care of drawing to the screen when a dbSync() is issued.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 6th Aug 2009 20:54 Edited at: 6th Aug 2009 20:54


Works fine for me, not sure what your trying to accomplish though.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 7th Aug 2009 03:59
I think what he wants is to use a single sprite to display one image, rather than 100 sprites all displaying the one image. He wants to paste the 1 sprite in 100 different places rather than 100 different sprites in 100 different places each loop. I dont know if thats possible though, I havent done alot with sprites.

Hope thats right and makes sense

If it ain't broke.... DONT FIX IT !!!
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 7th Aug 2009 21:38
yea my current map loading system uses 1 sprite to draw 300 tiles. I just used the above 2 lines of code in a loop system.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Aug 2009 21:43
If you are simply tiling, then there's not necessarily a need to use sprites. You can simply dbPasteImage for each tile you wish to place.

Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Aug 2009 22:19
Quote: "If you are simply tiling, then there's not necessarily a need to use sprites. You can simply dbPasteImage for each tile you wish to place."


Lets hope they are not trying for Isometric.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Aug 2009 00:40
Quote: "Lets hope they are not trying for Isometric."

Why?

Paste image works with alpha and image colorkeys just like the sprite command does...

Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 10th Aug 2009 00:50
can you use values out of the bounds of your with the x and y for PasteImage? I have not really played with it much, but the list of functions I have for images in the documentation is sparse.

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Aug 2009 14:57

Login to post a reply

Server time is: 2024-11-20 17:42:53
Your offset time is: 2024-11-20 17:42:53