Scrolling Text Object (No plugin, no masking)

  • I have searched the forums and have not found a solution not involving masking or a third party plugin, so I am posting this in hopes that someone else may find it useful.

    I am working on a project that has need of a scrolling Text Object (not text box). I didn't really want to install a third party plugin to accomplish this (it appears that they do exist,) and masking was not workable, so I started looking at a different solution. This, while not the most elegant or attractive, definitely accomplishes a "scrolling" type of effect that is sufficient to allow the text object's overflow content to be readable.

    Basically I am storing the full value of the text object in an instance variable (TextHolder), and then establishing a value (ScrollSize) on creation based on the width of the text box. When you scroll your mouse wheel or click the up/down arrows, it parses "TextHolder" and sets the visible text as needed, removing or adding "ScrollSize" characters as needed to move the text up or down. I am using a third instance variable (ScrollIndex) to keep track of how many times the text has been scrolled and ensure that it cannot be scrolled too far in either direction.

    I've attached the capx to illustrate this method.

    I hope this is helpful to someone, and I'd love to hear if someone has an idea on how this method could be improved upon.

    -VocoRobo

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)