0 Favourites

Advanced Spritefont

  • Tokinsom

    I would like to ask you something since your product is not ready to publish at store yet, I'm not going to ask your example but I need to know how you did this

    https://video.twimg.com/tweet_video/Cr46rDYUAAA9My1.mp4

    If you say something what you have done, It could help for my research. (I assume you spawned multiple sprite font each character, in this case a phrase contains more than 50 objects, correct? )

    Thanks!

  • -The text is a series of sprite objects with each frame acting as a character. They are spawned based on a string. If I recall correctly I used find() to get the index of the character so I know which frames to use.

    -The gray boxes behind the text act as the main spritefont object and contain all of the parameters such as the text to display (unless loaded externally), character map, size of text, etc.

    -The text tags / commands and queue are set up using regex and dictionaries. I learned this from the Dialogue System Template on the Scirra store, but added a lot to it to give individual characters and words their own behaviors and effects.

    -Word wrapping was accomplished by processing the text and adding newlines where necessary.

    Mine is functional and is already being used in some of my projects, but I think it lacks features that people will eventually need before submitting it to the store, such as horizontal and vertical alignment, justification, support for variable-width fonts, character scaling, and so on. Each one of these features affects the others so it's been very difficult to figure out. I would hire another programmer to finish all that but I don't know who to go to, and I don't have the time to figure it all out myself right now.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Tokinsom Interesing, you used the sprites instead of the sprite fonts, my intention was creating the default sprite font and the dictionary to preserve the properties of each character (sprite font object with single character) such as space, scaling, width, etc. per line which it preserves the width of a dialog. Each line must have contained the max width before to insert each letter, adding colors or effects can be added with special property such as "Ice" which it requires to call an extra object with extra event, also in loop can be "Ice1, Ice2, Ice3" to make nice wave effect.

    For better performance, I'd use paster plugin to generate texture of static characters in dialog window when it reachs the length is more than 10 of characters will destroy the first instances of sprite font which is already created. I haven't tried it since I wasn't sure about the process but I believe it would work BUT it won't paste the special effect on each character such as glow, waves, etc. will be active objects.

  • -The text tags / commands and queue are set up using regex and dictionaries. I learned this from the Dialogue System Template on the Scirra store, but added a lot to it to give individual characters and words their own behaviors and effects.

    Glad to know my hacky way of doing things has learned you something Tokinsom.

  • > -The text tags / commands and queue are set up using regex and dictionaries. I learned this from the Dialogue System Template on the Scirra store, but added a lot to it to give individual characters and words their own behaviors and effects.

    >

    Glad to know my hacky way of doing things has learned you something Tokinsom.

    Hey, if it works

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
207 72,484
blackstr's avatar
blackstr
Unread hot topic
198 47,129
Zebbi's avatar
Zebbi
Unread hot topic
167 39,784
lucasgc1's avatar
lucasgc1