[Suggestion] SpriteFont Y Offset

Discussion and feedback on Construct 2

Post » Sun Sep 08, 2013 10:50 pm

Hello,

I think it would be great to add an Y offset to each printed character of the offical sprite font plugin. It would simply display characters from the charmap starting this offset. One application would be to support different colors by just adding the same charmap with a different color below the original one and changing the offset.

What do you think ?Nemega2013-09-08 22:58:08
B
5
S
1
G
1
Posts: 24
Reputation: 538

Post » Sun Sep 08, 2013 10:52 pm

This is actually a pretty good idea!

+1
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Mon Feb 24, 2014 11:36 pm

Sorry to bump, but I've been looking into this and haven't found a good way to do it..

Anyone know how can I achieve something like this? It would be pretty cool if I could use something like

"This is a [red]test[/red]"

or maybe

"This is a"&spritefont.offset+value"test"

I haven't looked into it enough but any clues as how to achieve that would be deeply appreciated!
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Tue Feb 25, 2014 2:45 pm

One method ive been using for text shadows is making a duplicate of it, then manually setting the offset and color
B
14
S
3
G
4
Posts: 61
Reputation: 3,519

Post » Mon Aug 11, 2014 1:13 pm

@andreyin That would be cool, did you find a solution?
B
147
S
74
G
20
Posts: 1,786
Reputation: 22,527

Post » Mon Aug 11, 2014 1:19 pm

andreyin wrote:Sorry to bump, but I've been looking into this and haven't found a good way to do it..
Anyone know how can I achieve something like this? It would be pretty cool if I could use something like
"This is a [red]test[/red]"
or maybe
"This is a"&spritefont.offset+value"test"
I haven't looked into it enough but any clues as how to achieve that would be deeply appreciated!


Don't know how Spritefont works from rendering side. But having multiple frames/animations (like in sprite) where each frame/animation could be a different color texture could be a solution.

And doing something like this "This is a [red]test[/red]" will simply mix "letter parts" of these frames/animations as needed.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Mon Aug 11, 2014 8:15 pm

@alspal

I haven't! ):

The current SpriteFont object won't allow you to change the Y offset..

It's probably doable though if you have 2 SpriteFont objects one on top of the other, then somehow only showing the colored letters on one of them. Not sure how to achieve that though.
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Tue Aug 12, 2014 7:15 am

I don't think that would work too well, unless the image has no transparent parts.

An example of what colored Spritefont text could be like:

Image
B
147
S
74
G
20
Posts: 1,786
Reputation: 22,527


Return to Construct 2 General

Who is online

Users browsing this forum: lukewasthefish, unicornspitfire and 7 guests