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 / "Centered" sprite appearing in the corner?!?

Author
Message
medsouz
14
Years of Service
User Offline
Joined: 10th May 2010
Location:
Posted: 23rd May 2010 19:24
I'm trying to make FPS crosshairs from an image I made but when I try to center the image it appears in the bottom right corner...

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 23rd May 2010 19:31
I think your problem is that the x,y coordinates you give to a sprite are taken to be those of the top left hand corner of the sprite. Thus, you will probably find that the top left of your picture is in the center but this gives the impression of being in the bottom right. What you need to do is to use the offset sprite command. This allows to too deturmine from where the sprite is drawn. Thus I would try some code like this:



Hope this help.
medsouz
14
Years of Service
User Offline
Joined: 10th May 2010
Location:
Posted: 23rd May 2010 19:33
I spent the past hour working on that and you figure it out in less then 5 minutes...

I really need to learn more about BASIC.
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 23rd May 2010 19:34
Glad to help

Login to post a reply

Server time is: 2024-11-24 15:25:36
Your offset time is: 2024-11-24 15:25:36