Taking Suggestions for Bitmapped Font object

New releases and general discussions.

Post » Wed Jun 10, 2009 7:27 pm

I'm going to be making a Bitmapped font object, also known 'round these here parts as a Text Blitter:
for those who don't know, this is where you have a separate sprite for each letter, so you can type some text, and have it come on screen like this:


I want it to be as easy as possible and as powerful as possible to use. The purpose of this thread is to take suggestions, and release the most complete solution possible. It will be easier to build it correctly the first time, than to add features later.

so far, these are the features I'd like to include, and how some of it will work. If the operations I suggest sound annoying or tedious, please feel free to suggest a better workflow.

First you need to get your letter images into construct.
I have two methods I have thought of that seem like the simplest to me. I plan for the plugin to support both. If I have missed an input method you would like to see, please reply and suggest.

first is a fontstrip, you would choose a sprite like this:

Only the extra words at the bottom would be cut off, so it would just be the list of characters
you tell construct how many letters across and down, and then specify the order of the letters

I think there should be a few methods to do this,
1.in ASCII order. Many font strips you see will be in this order anyway. And you can specify a range...for instance if you had a font strip just for 0-9
you would choose the action
Get Font From Font Strip,
tell the x size,
the y size,
then there would be a drop down list of the first Character, where you could select 0
and the last character, where you could select 9
and that would be it for the first method

the second would be to specify a list of all the characters, so basically, you call the action, and type in:
"ABCDEFGHIJKLM"
etc., that way if the one perfect font just isn't on an ascii ordered strip, you can specify your own order.

also, you should be able to combine imported fonts, so if you imported 0-9, and A-Z, separately, you can tell the object that this is still one font.

you can define an offset if you want them to be spaced closer or further than the borders of each sprite when you type


the other way to import the sprites for your font strip would be through the animation editor
you have a directory with one sprite per character, import those into the frames, call the action as above, except you wouldn't specify x and y values for an imported animation.

with this method you could have vastly different sizes for each character. you will be able to specify the spacing with an imagepoint to override the spacing that you set. Also, you should be able to set the spacing at the borders of the sprites,
or from the hotspot, so you can easily make cursive or graffiti style fonts that overlap uniformly

you will be able to set the size, of course, (and rescale it nonuniformly, to squash or stretch the "fonts") and the angle. as well as whether text is centered, left, or right justified. I will try to make the first version realtime editable, so a player can type in their name for instance, and it will appear as they type, along with backspace. This will take longer than the other features, though, so it may come later. Another thing I'd like to have is being able to set the width of the typing space, so you can have automatic word wrap...

anyway, when it's all ready and done, you use the TextBlit Action "Hello, World" at 40,500,200
and it would type it to screen with your bitmaps instead at xy 40,500, and at zdepth 200

please feel free to make suggestions, especially if you have a good idea to streamline the way you set what sprites you want for fonts. Don't worry about how it will work, or if it can work, just tell me what would be easiest

Also, I'm trying to develop any plugin I can to add general functionality to Construct. Like the Custom Keys plugin, this is a feature that can be used by almost anyone, and is used in a large number of polished titles. If you can think of any type of basic useful functionality you'd like to see in construct, that is not already planned by the devs, and is generally useful to anyone trying to make a finished game, please suggest it here. As a disclaimer, I will say, I can't do things like make an online plugin. Think of things you can already do with construct, but would take forever, and cause you to have to slow down the breakneck pace that Construct usually let's you develop in
I will be developing plugins to fill those gaps.

Edit: Mods and Devs, please let me know if this is the wrong forum to post this. Plugins forum is mostly frequented by plugin devs, and aspiring plugin devs, and I wasn't sure if
Feature requests: Suggest and discuss specific additions to Construct and to plugins
would be appropriate. I want make this a complete and useful plugin, for as many users as possible, but I don't want to impose, botlike, upon the wrong forum, because there will probably be a handful of plugins in the Useful Series.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Jun 10, 2009 8:11 pm

Does it have to be text blitter? Wouldn't it make sense to have an universal blitter, which could be used for text and imagesets alike?

I know blitting is probably a little ineffective, having to read the same big image for each smaller bit of graphics to be blitted seems ineffective compared to just drawing smaller independent images. Perhaps it would be better if it was an one-time thingy; load an imageset, chop 'em up and store each piece into their own textures, which would then be referred for the remainder of session (or until dumped).

Well, anyway, I'm not an expert and blitting feature is not so strongly requested, since there are alternative methods of drawing graphical text. I'm sure others will digress, though.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Jun 10, 2009 8:30 pm

[quote:1g6tljjb]blitting feature is not so strongly requested, since there are alternative methods of drawing graphical text. I'm sure others will digress, though.[/quote:1g6tljjb]

Actually, it's been requested a bunch. I know I'd like to have a text blitter.

Just one thought though, and it's not all that important... how about instead of calling it "Text Blitter Object" it's called "Bitmap Font Object?" Text Blitter is what it's called in MMF.

I know, I'm being nitpicky :(
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jun 10, 2009 8:46 pm

ok, done deadeye.
I was thinking of changing the name anyway since too many people don't thinking of text blitting in the nonstraightforward nostalgic sense anyway.

Mipey
seems a little redundant, since you can split up images in the animation importer. but if enough people agree it's a needed feature, it shouldn't be a problem. splitting up a bunch of sprites into smaller ones doesn't seem like a problem you'd have unless you're using retro sprites you found already that way on the internets, so no as you said, it's probably not needed much.

but although there are ways of drawing graphical text, aside from importing sprites of every word you want, or tediously placing all the letter and number sprites in order, or making this plugin out of events. Any of those three methods takes enough time, to make it a small project in itself.

with this you can have scores that change dynamically, names that pop up above characters
or button setup screens, stories scrolling up the screen, without giving a second thought to it, the way you would if it was a text object. As I said before, most games polished enough to be released commercially have something like this, somewhere in them
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Jun 10, 2009 9:15 pm

One thing I think is cool about bitmapped fonts is you have the ability to create all kinds of text effects, like scrolling text, etc. One thing that might be interesting is if it was set up to make these effects easier, perhaps programmable, and shareable.... ehh that might just have to be a separate plug. :P
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Thu Jun 11, 2009 10:19 am

I had a look into making one, but had a lot of work to do at the time. I was going to use BMFont for it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Jun 11, 2009 11:39 pm

Dude! nice!

Okay my requests for bitmapped font (brace for wall-of-text):
-Unicode support! I need 's and and I'm sure others will need other codes. Unicode is nicely mapped too so it's no biggie I think. Just index using UTF16 as a key.

-Kerning: Kerning is the distance between two glyphs, you just need a table with kerning between each pair of existing glyphs. I know typographically inclined people go NUTS over this and it differentiates a mediocre font renderer from a beautiful one. Just default to 0 (monospaced). The nice thing about this is that you can have variable size glyphs regardless of actual glyph size. Also, it makes measuring string lenght hell (ok not so bad, but it's not a simple mult anymore).

-resulting text alignment: left, center, right, up, middle, bottom.

-baseline: vertical position of glyphs is defined relative to a baseline. This allows for j's that drop below among other aesthetically pleasing glyphs.

I don't care for bold and italics. They can be a separate font like in every single existing system today.
I don't care for effects. I had to design a font object once and would up dropping effects altogether as they were making the design explode in complexity. If you already have this figured out then great.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Jun 12, 2009 1:34 am

Awesome! One feature that's really needed - accurate word wrap. The current text object will write a sentence, and if a period gets wrapped, it doesn't wrap the word with it - like this
.

Ashley said it's an issue with direct x that they can't do anything about, so it would be really nice if your plugin wraps correctly.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Jun 15, 2009 12:08 am

ok
it's still a little ways off, mostly because I'm busy...it really doesn't take too long to make a plugin

these are the features that will go in, if all works out:
actions:
[list:184ugcpm][*:184ugcpm]choose sprite, there won't be any special setup options, because splitting up tiles, and importing several frames, is very easy with the builtin features in construct, so you import your font sprites into one animation in construct
[/*:m:184ugcpm]
[*:184ugcpm]Set Animation Range: here you will be able to set up a range of characters to go with a range of frames, so if your font only has 0-9, and a-z, you would call this action once for each range, you choose which animation frames go with which range of characters [list:184ugcpm][*:184ugcpm]Frame Start[/*:m:184ugcpm]
[*:184ugcpm]Frame End[/*:m:184ugcpm]
[*:184ugcpm]Character Start[/*:m:184ugcpm]
[*:184ugcpm]Character End[/*:m:184ugcpm][/list:u:184ugcpm]
[/*:m:184ugcpm]
[*:184ugcpm]Set Spacing: this will set how far the next character will be placed from the last, you will be able to set whether the space is from an imagepoint or from the edge of the sprite[list:184ugcpm]
[*:184ugcpm]from imagepoint/from edge - edge is default[/*:m:184ugcpm]
[*:184ugcpm]all / per character - apply spacing to all, or override "all" setting for one character - setting for one character, decides how far the next character will be from it[/*:m:184ugcpm]
[*:184ugcpm]spacing - a number, 0 would be touching, negative positive corresponds to left/right number of pixels offset [/*:m:184ugcpm][/list:u:184ugcpm]
[/*:m:184ugcpm]
[*:184ugcpm]set wrap width - set the width the words wrap in. I will do my best to follow any wrapping conventions I'm aware of, but I don't have the time to research, and I'm not an expert on formatting, but I did read yours arima, and that will be observed
[/*:m:184ugcpm]
[*:184ugcpm]set display width - this is to be able to put your text into a box and scroll through it, it will make some of the other actions possible, and save the user from having to make a mask everytime they want to do this
[/*:m:184ugcpm]
[*:184ugcpm]set alignment - left/right/centered
[/*:m:184ugcpm]
[*:184ugcpm]set justified -
[list:184ugcpm][*:184ugcpm]on/off[/*:m:184ugcpm]
[*:184ugcpm]method[list:184ugcpm][*:184ugcpm]between word spacing - justify the normal way, by spacing words apart[/*:m:184ugcpm][*:184ugcpm]per character spacing- justify by spacing each character[/*:m:184ugcpm][*:184ugcpm]by character width - justify by setting the width of each character[/*:m:184ugcpm][/list:u:184ugcpm][/*:m:184ugcpm][/list:u:184ugcpm]
[/*:m:184ugcpm]
[*:184ugcpm]attach to object -sets height and width to an object
[list:184ugcpm][*:184ugcpm]border left[/*:m:184ugcpm]
[*:184ugcpm]border right[/*:m:184ugcpm][*:184ugcpm]border top[/*:m:184ugcpm][*:184ugcpm]border bottom[/*:m:184ugcpm][/list:u:184ugcpm]
[/*:m:184ugcpm]
[*:184ugcpm]set all/per character width Absolute/ or ratio (to the original character size)[/*:m:184ugcpm]
[*:184ugcpm]set all/per character height Absolute/ or ratio (to the original character size)
[/*:m:184ugcpm]
[*:184ugcpm]set capital/lowercase size - allows you to make capital of lowercase letters, by adjusting the size ratio x/y[/*:m:184ugcpm]
[*:184ugcpm]set scroll x/y ( relative/absolute) - offset from phrase position[/*:m:184ugcpm]
[*:184ugcpm]set rotation (of entire phrase)[/*:m:184ugcpm]
[*:184ugcpm]set position (of entire phrase)[/*:m:184ugcpm]
[*:184ugcpm]set circular x/y (on/off) - this makes it so a letter scrolling off the left side, comes back out the right side if you scroll beyond the end of the phrase[/*:m:184ugcpm]
[*:184ugcpm]set phrase width - sets the width ratio of the letters, so they all fit into this width[/*:m:184ugcpm][/list:u:184ugcpm]

now I will have to be careful with the naming of actions, because you will be able to do this per character meaning "a", so every "a" is set to a certain width or per character, to be used with the following condition:
[list:184ugcpm]
[*:184ugcpm]For each character in phrase - which could do all of the above functions, but per character in phrase (in order regardless of what letter it is), this will make it possible to do all the crazy stuff you'd want to do with bouncy swirly, zigzaggy text, text wrapped in a circle, it's up to you to come up with the algorithms, using the actions, and the following conditions: (most of the "get" conditions will also have a "get previous" and "get next" but I don't want to write all that out)
[/*:m:184ugcpm]
[*:184ugcpm]get character x/y[/*:m:184ugcpm]
[*:184ugcpm]get character position in phrase [/*:m:184ugcpm]
[*:184ugcpm]get character distance from left/right/top/bottom edge (of text display width)[/*:m:184ugcpm][/list:u:184ugcpm]

oh yes, and of course actions to put the text to the screen :)

please let me know if I missed anything.

edit: davio added request for outputting character by character one at a time, and a corresponding "on character typed" condition to add typewriter sounds for instance

also, letting users use your text as an edit box, is a feature I plan to add later, after a stable build (of this plugin)
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jun 15, 2009 12:35 am

This might sound a bit weird, but wouldn't the effects like swirls, zigzag, etc be better in a behavior you could attach to any object? I'm thinking the behavior could run off of for each object(ordered) in a family. Then the behavior could have several types of movements built in.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests