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! / Unusual animated sprite problem, please help.

Author
Message
Lampshade Lad
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 17th Feb 2009 20:43
First time here, please be gentle.

Yes, in this very short program I have developed so far, I have a sequence of animated sprites get defined early on, and used near later, being displayed one on top of the other in a menu selection system.

The problem is that the only sprite that cysled through all it's frames properly is the last one to be made near the top, so the other two when highlighted stretch and distort themselves off the side of the screen, albeit while being animated like they should.

I've tried loading the relevant sprite when the appropriate menu selection is highlighted and deleting it when not being used, but that only worked on the more powerful computers in my college, and as I suspected, slowed down the process on every other system.

I'm at my wits end. Being new to DarkBASIC, I'm not putting the code on this message yet, because it might be a common issue, and this is long enough as it is. But I will attach it if requested.

First hurdle? What? Oh, that thing at my feet. Yeah, that was me, sorry.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Feb 2009 21:34 Edited at: 17th Feb 2009 21:35
best practice is to load your media up front and hide it until it's needed. show it where appropriate, then hide it again.

it sounds like you might be scaling, positioning or offsetting sprites incorrectly (or not as you'd expect them to be) but we really can't help with the issue you're describing unless you provide an example. don't worry if it's a common issue, and don't be afraid to show us your code (if you are). we've all been there before, many times over. some of us are still there

i should mention... while this is a 2d/sprite issue, the 2d thread is generally for art-related talk. you might get more, better/more informed help by posting in the appropriate dbc/dbpro areas.

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Lampshade Lad
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 17th Feb 2009 21:44
Ah, my bad. I just saw 2D and assumed...

Oh, and I tried the method you said first time, and that's why I'm stuck with this innefective method of getting things done...

Uh.... should I just copy and paste this bad boy straight on? Or is there a better way?

First hurdle? What? Oh, that thing at my feet. Yeah, that was me, sorry.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 18th Feb 2009 18:35 Edited at: 18th Feb 2009 18:52
hit the code button, paste the code, hit the code button again.

that will produce:


or:



Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-29 01:21:30
Your offset time is: 2024-03-29 01:21:30