Inconsistent Tweening using TextHeight?

0 favourites
  • 3 posts
From the Asset Store
Calculate parabolic trajectories and tween objects over them.
  • Hello! Longtime lurker first time poster, etc. I'm running into an issue in a dialogue-focused game creating text bubbles that scroll upwards with each new tap. Simple enough, or so I thought. Here's where things currently stand:

    See how the spacing between the text bubbles is awkward and inconsistent? Here's a slice of the visual code that produced that:

    This snippet is essentially replicated across every instance of calling a text bubble. (Sorry in advance for very messy code. I'm new!) I have a feeling my issue has something to do with either a tweening-all-at-once conflict, or unseen variance in my textheight. Either way, I don't know how to fix it! Any ideas?

    Here's my Construct file if anyone has a minute of their day to make mine. To test the textboxes, you can just press "hit" and the text bubbles will appear.

    drive.google.com/file/d/1ma_Mpi4o9dCAyWxYvptMDylnWZej6T5l/view

    I'm happy to answer any questions about the way this has been designed, since it's a little complex (to me). I just finally broke down and resigned to request help, haha. Thank you very much in advance!

  • There's probably a mistake in calculations. But your code is impossible to understand.. You have almost 500 events which probably could be optimized to 50 or less. You need to read about functions.

    I suggest temporarily disabling those tweens and replacing them with simple "Text set Y". See if this fixes the issue with uneven spacing. If it does, the problem is likely with wrong timings - you are calculating the coordinates for new tweens based on previous tweens which have not finished yet. But this is just a theory.

    Use Debug Mode - you will be able to pause the game and check everything. Console logging is also extremely useful when troubleshooting - add "Browser Log" actions to key events, you can print out information like object coordinates, variables etc. Press F12 in preview and check the log.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you for your reply! I managed to figure it out, if you're at all curious---the temp textbox I was using as a buffer was a different font size than the core text box, causing a textheight discrepancy. It's always the simple things. Thanks anyway!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)