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 / How to make 2d skeleton invisible? I want to optimize my code.

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 3rd Oct 2015 15:51
How to make 2d skeleton invisible? I want to optimize my code.
Loading of 2D skeletons takes so much time and I don't want to delete it every time I need - just to hide it some how(like SetSpriteInvisible(spritenum)).
And hidden skeleton must not take the processor or GPU time!
Please help.
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 3rd Oct 2015 16:06
There is a SetSpriteVisible(id,0) which does the hide bit or SetSpriteVisible(id,1) to make it visible again.
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 3rd Oct 2015 18:37
Juney, did you read my post? I'm talking about 2D SKELETON! Not about sprite!
Phat
10
Years of Service
User Offline
Joined: 20th May 2014
Location:
Posted: 4th Oct 2015 10:56 Edited at: 4th Oct 2015 10:56
I'm not sure... Cause i don't use 2d Squeletons.

With SetPhysicsDebugOn() ?
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 4th Oct 2015 13:24
Phat, OMG
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 4th Oct 2015 13:41
I think there is no such a function, so just forget about it.
Wilf
Valued Member
18
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Gone to Unity.
Posted: 5th Oct 2015 17:21
You are right, there is no SetSkeleton2DVisible command yet. What I do is make a 'hidden' animation with all Slots and Images set to 0 alpha in the Color key. Then I play that animation once (it needs at least 2 position keys or else AppGameKit will crash); Once its stopped playing it should not be updating in the 2d system or causing any performance issues.

Login to post a reply

Server time is: 2024-11-16 22:17:55
Your offset time is: 2024-11-16 22:17:55