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 AppGameKit Corner / Image offset issue

Author
Message
SirWinston
8
Years of Service
User Offline
Joined: 25th Aug 2016
Location:
Posted: 8th Oct 2016 06:56
Hi guys,

See attached. What's going on here? Relative to the sprite, the Y location of the image is correct. But the X position appears to be placed at the sprite's centre of rotation?

The image rotates and follows the sprite perfectly, except for being about fourty pixels in front of the sprite itself? Come to think of it, is it the physics object that is positioned incorrectly?

Every command I have come across appears to affect which part of the image is drawn, not where it's drawn! All I want to do is shift the X location of the picture to the left edge of the sprite?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Oct 2016 10:09
You haven't attached anything
It will also be useful to see the sprite in isolation, the code for setting up the sprite, and the code for moving it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
SirWinston
8
Years of Service
User Offline
Joined: 25th Aug 2016
Location:
Posted: 10th Oct 2016 07:43
I dunno what happened there. Here's the image.

Attachments

Login to view attachments
SirWinston
8
Years of Service
User Offline
Joined: 25th Aug 2016
Location:
Posted: 11th Oct 2016 04:05
I found the issue:



I have no idea how I expected that to work.

Thanks guys
SirWinston
8
Years of Service
User Offline
Joined: 25th Aug 2016
Location:
Posted: 11th Oct 2016 04:10 Edited at: 11th Oct 2016 04:49
I know how I screwed up. I was playing with SetSpritePhysicsCOM, and moving the X position changed the sprite's handling in a more "fun" way.

Is changing the sprite offset supposed to affect sprite image's position?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Oct 2016 12:44
Quote: "Is changing the sprite offset supposed to affect sprite image's position?"


Yes, if you are using SetSpritePositionByOffset()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-25 01:19:32
Your offset time is: 2024-11-25 01:19:32