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 Screen Center Sprites in DBP

Author
Message
ArsA
20
Years of Service
User Offline
Joined: 5th Jul 2004
Location: Virginia, USA
Posted: 6th Jan 2005 12:29 Edited at: 6th Jan 2005 12:39
Can somebody help with this one?

I tried:


It gives me the prfect half, but the sprite still doesnt center, Im trying to create a fade out effect, the picture kinda of zoom in from the center, but it always zooms from the corner or something..

any help appresiated

Thanks

- Just Me!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Jan 2005 12:49
Try something like this.



or



ArsA
20
Years of Service
User Offline
Joined: 5th Jul 2004
Location: Virginia, USA
Posted: 10th Jan 2005 11:27
that helped me alot, thanks

- Just Me!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 10th Jan 2005 12:56
Glad you got it working.

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 14th Jan 2005 12:18
Also, you could set the X and Y offsets of it by half of their respective sizes.

Hi
soapyfish
20
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 15th Jan 2005 01:03 Edited at: 15th Jan 2005 01:04
Like Mattman said, if you don't want to work out the exact value for every single sprite, you can offset the sprite to automatically draw from the center.

Normally the sprite is drawn from, I think, the top-left, so the top left pixel will be placed where you said on screen, in this case the centre. If you want the middle of the image to be used as a reference instead just use something like this.....






Formely code2kill
Is it really that hard to check your spelling before clicking the Post Message button?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 15th Jan 2005 01:09
I know, let's all repeat Lost in Thought's first code snippet that already showed correct use of offset sprite command.

Boo!
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Jan 2005 08:40
Quote: "I know, let's all repeat Lost in Thought's first code snippet that already showed correct use of offset sprite command."


Whatever makes you happy

MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Jan 2005 08:57 Edited at: 15th Jan 2005 08:59

Login to post a reply

Server time is: 2024-09-23 09:18:25
Your offset time is: 2024-09-23 09:18:25