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 / Unexpected behaviour - Tweening and sprite X Y offsets

Author
Message
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 11th Jun 2015 20:15 Edited at: 11th Jun 2015 20:16
I'm not sure if I'm being dim here but when using the tween system in AGK2 to move a sprite across the screen, how do I tell the tween to use the sprite offset to position it?

e.g.


If you run the above code (assuming I've written it right!), you will see a yellow square slowly expand (in the middle of the screen because it's using the sprite offset) to fill half the screen (horizontally). Uncomment out the line shown, and you will see that the square now moves right but the expansion in size is from the top left corner of the sprite, not the centre as it was previously.

Am I right in thinking this is not expected?

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 12th Jun 2015 03:48 Edited at: 12th Jun 2015 04:01
Yeah, it looks like the settweenspritex is resetting the sprite offset to 0,0.

Here is a AGK2 friendly version (your code didn't work for me, but I got the gist):

This one illustrates the problem even better.



Funnily enough, I reported this bug AGES ago, but couldn't replicate it when trying to show an example, so I'm glad you found it! Well spotted. The tween commands are supposed to use the offset values by default (not sure why - shouldn't there by a set of byoffset versions of the tween commands for continuity?). Hopefully Paul can squeeze a fix for this in between his 3D coding.

V2 T1 (Mostly)
Uzmadesign
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 12th Jun 2015 12:13
Thanks CJB - should have tested my code first! Glad I'm not just doing something stupid.

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
Grook
AGK Backer
12
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: Lancashire, England
Posted: 18th Jun 2015 21:52
Sorry to bump this but is there still a bug list? If so, is this already on it? I can code around it but it's a bit of a pain in the bottom.

"It is said that your life flashes before your eyes just before you die. That is true, it's called Life.”
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 22nd Jun 2015 11:58
Bumping again as not yet heard from Paul on whether this is going to get fixed for next version.

V2 T1 (Mostly)
Uzmadesign
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 23rd Jun 2015 18:56
Welcome to the club. I posted about this limitation last August and nothing has been done. I also think the built-in tween commands should support binding them to simple data types so the tweening can be used for arbitrary values and not always tied to sprites etc. For now I just use custom functions to manage tweening, unfortunately that is what I must do since the tween command set is only partially complete like other components of AGK.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Jun 2015 22:53
That is the unfortunate truth about AGK. It has many partially complete components (adverts, Facebook, In App Purchasing, tweening etc.) and now Paul is working on 3D commands. So presumably they will get partially completed before he moves on to something else.

Obviously a lot of people are crying out for 3D commands (me too) but I'd much rather see everything else fully functional first. In an ideal world though there would be more than one dev on the job so that 3D commands could be worked on at the same time as other partially complete components become fully complete.

AGK V2 user - Tier 1 (mostly)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jun 2015 10:54
Quote: " I also think the built-in tween commands should support binding them to simple data types so the tweening can be used for arbitrary values and not always tied to sprites etc."


Yes it would be nice. For now, I create a hidden sprite, make a tween from Y position 0 to 100, and get the position to apply to other elements.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Jun 2015 15:50
I am also using BatVink's solution in my particle system which uses tweening.

Using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-11-25 21:51:44
Your offset time is: 2024-11-25 21:51:44