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 / Transparent objects and tweening

Author
Message
Yaro
10
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 12th Mar 2015 10:36
I'm using SetTweenTextAlpha to fade out text , but as a result it's leaving quite a few completely transparent (0 opacity) text objects. How much does this impact performance, particularly on mobile devices? Is there an easy way to delete the text objects after they've faded out, or at least a way to identify when a tween ends without explicitly providing the textID?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Mar 2015 11:25
You could add the IDs to an array with the time that they can be deleted.

It's a good idea to track all of your entities in an array anyway, then adding a tween expiry parameter would be quite easy.

Quidquid latine dictum sit, altum sonatur
Yaro
10
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 14th Mar 2015 12:28
So when I try to implement it in the code below, my program crashes. It still creates the text objects fine, and I'm able to verify that it does exist, but the call to DeleteText always crashes it.


And here's where I create it, but like I said, it's creating them fine. It's just trying to delete them that causes the crash.


That's it so far as interactions with the text objects go. Am I missing something or doing something wrong? I was able to get the sample code on the command page to run, just can't figure out why or where it goes wrong with mine.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Mar 2015 15:54
What is the error when it crashes? The only I see that could fail is that your array index (ShotText.NextToDelete) is out of bounds.

Quidquid latine dictum sit, altum sonatur
Yaro
10
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 14th Mar 2015 20:45
I just get a generic "This program has stopped working" message. Another point of confusion is that it breaks as soon as I create the text, even though I'm using the if statement to check the deletetimer.

Attachments

Login to view attachments
Yaro
10
Years of Service
User Offline
Joined: 29th Mar 2014
Location:
Posted: 14th Mar 2015 20:53
I fixed it, the problem was that I used > when I needed to use <, so I was attempting to delete text before Sync() was called after the CreateText. I blame staying up too late.

Login to post a reply

Server time is: 2024-04-25 01:21:32
Your offset time is: 2024-04-25 01:21:32