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 / How to position a sprite?

Author
Message
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 14th Feb 2010 20:36
How do you position a sprite at an exact location?

I can only use OFFSET SPRITE, which just shifts it's location, not positioning it at an exact point.

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Feb 2010 21:04
SPRITE Sprite Number, XPos, YPos, Image Number


example : screen 1024*768 and we want to position our sprite in 200,200

sprite 1,200,200,1



cheers.

learning every day
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 14th Feb 2010 21:33
Well, I meant a sprite that was already on the screen...

But now I realize that the function can work when it's already on the screen.

Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 14th Feb 2010 23:30
Okay, now that I can position sprites, how can I put a fading transition on them?

So they just don't pop in and out.

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Feb 2010 02:19
set sprite alpha is what you're looking for.

meanwhile, there aren't many sprite commands to learn so i suggest hitting f1 and reviewing each.

good luck

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
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 15th Feb 2010 02:21
I've tried using a for loop to set sprite alpha but it doesn't work.

It's just invisible for a moment and then visible.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Feb 2010 02:29 Edited at: 15th Feb 2010 04:06
Try this:



It randomly draws ten sprites (boxes) on the screen and fades them in. You may have to adjust the sync rate for your computer to see the effect better.

Hope this helps.

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Feb 2010 02:57 Edited at: 15th Feb 2010 03:02
Quote: "It's just invisible for a moment and then visible"

it's doing what you want it to except it's too fast to see. so, slow it down using a timer

i had whipped this up while LBFN was adding his:



add: syntax highlighter still unfinished so i took it out.

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
Mew151
16
Years of Service
User Offline
Joined: 1st Jun 2008
Location: Glitch city
Posted: 15th Feb 2010 02:59
Alright I got it. It must have been something with my method on increasing alpha value.

Login to post a reply

Server time is: 2024-11-24 20:31:36
Your offset time is: 2024-11-24 20:31:36