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.

AppGameKit Classic Chat / SetSpriteOffset()

Author
Message
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 1st Apr 2020 01:47
The SetSpriteOffset command isn't working for me. The program just defaults to top left handle.

I searched the boards and found a few articles....but is this command defunct?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Apr 2020 06:02
This is posted in the wrong forum
is it agk or darkbasic etc you want

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 1st Apr 2020 09:17
agk
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 1st Apr 2020 12:06 Edited at: 1st Apr 2020 22:53

KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 1st Apr 2020 22:31
I'm sorry qugurun, I don't get it. As far as I am aware, the setSpriteSize() function does not work as a stand-alone command.

It does not do what it says it should do.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 1st Apr 2020 22:54
You are right, this command is not needed here, the default size is 10 by 10.
Edited by.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 1st Apr 2020 22:58 Edited at: 1st Apr 2020 22:59
Your need use command SetSpritePositionByOffset (id,x,y)
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Apr 2020 23:23
Quote: "the setSpriteSize() function does not work as a stand-alone command."

no the sprite has to exist

can you post some example code so people can see what you are trying to do
it will help someone work out what your doing wrong

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 1st Apr 2020 23:47
My apologies to all.

I meant the SetSpriteOffset() function does not work as a stand-alone command.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 2nd Apr 2020 03:48
Many thanks...I will examine the code and see what is going on.

Just for reference, I was trying to make a graphic follow the mouse with the centre of the graphic at the mouse point.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2020 06:03 Edited at: 2nd Apr 2020 06:05
SetSpritePositionbyOffset(id,x,y) (use this command when you want to position anything other than by top left)
Should by default be the centre of the sprite
SetSpritePosition(id,x,y)
is the top left corner

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 2nd Apr 2020 07:10
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 2nd Apr 2020 22:50
Well...that was unexpected.



It works. But why does setSpriteOffset() not work as the manual says it is supposed to?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2020 22:54
it does you just have to use setspritepositionbyoffset or it wont and not meant to

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
KayDee
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location:
Posted: 3rd Apr 2020 05:48
Many thanks


...end of line

Login to post a reply

Server time is: 2024-03-29 15:56:06
Your offset time is: 2024-03-29 15:56:06