Advanced Spritefont

Get help using Construct 2

Post » Sun Feb 05, 2017 5:56 pm

@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!
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Tue Feb 07, 2017 10:23 am

-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.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Tue Feb 07, 2017 1:50 pm

@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.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Tue Feb 07, 2017 3:49 pm

Tokinsom wrote:-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. ;)
B
74
S
31
G
26
Posts: 994
Reputation: 20,198

Post » Wed Feb 08, 2017 11:16 pm

Magistross wrote:
Tokinsom wrote:-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 :P
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 12 guests