SpriteFont (v0.99.5RC) - new update, small bugfixes

Forum Home Forum Home > Construct Classic > Construct Classic Discussion > Work-in-progress addons
 Post Reply Post Reply Page  <1 23456 21>
Author
1,643 Rep
Post Options Post Options   Quote konjak Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 2009 at 9:17pm
Is it possible or will it be possible to make like parts of one text grab letters/images from a different source, so that you might have room for symbols or differently colored text in the middle of regular sentences?

I love doing that. Back with MMF's Text Blitter I used to take its character map (the one, large image with all letters that 'Blitter then cut up automatically) and offset the image in the middle of sentences to ascii tables with differently colored text or symbols. Of course, this one doesn't work that way and instead much more comfortably supports variable width letters, but will there be or is there a way to "offset" or switch letter source in the middle of sentences yet?
Back to Top
11,225 Rep
Post Options Post Options   Quote lucid Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 2009 at 1:37am
there are alot of symbols you might never use in text like ~ or ^ or },], or |
that you can replace with symbols of your choice
as far as changing the color, you can easily cycle through and replace a word with a certain color tint
like (assuming the sprite containing your letters is called lettersprite)
[code:1edec5fs]For Each Word In Phrase
compare currentword = fire
- lettersprite-tint = red[/code:1edec5fs]
this would find any sprites making up the word fire in your paragraph, and tint them red

also for symbols you could do something like (if you need every ascii character, and can't sacrifice any for special symbols
[code:1edec5fs]if current word = "(~_^)"
-for each letter
--currentletter = "_" <----the center underline in that little symbol
---system-create SpecialHappySprite at LetterSprite.x,LetterSprite.y
--always Destroy LetterSprite[/code:1edec5fs]
this would find any sprites making up the 'word' (~_^) and put your SpecialHappySprite in the middle of it, and destroy the original sprites making up the word (~_^)

the currentletter, and currentword exressions combined with the ForEachLetter and ForEachWord conditions allow you to do very powerful and flexible things
you could also change the size or position of certain words, only if they were in certain positions

Set Text "fire! there is a fire in the house"
For Each Word
---currentword == fire
------position in phrase = 1
--------------make red

would only make the first word red if it was fire, but not the other fire
also, since they are sprites, you can do other things to them, like make them fade in and out, etc
anything you can do to sprites;


don't want to get too far off track here, but I'm not sure what you were trying to do so
you can also do things the other way around, like

if mouse is over LetterSprite
---pick current word
----if currentword = "hyperlink"
-----tint red

and lastly, if youyou had rpg dialog writing text letter by letter
and you set your special little "press A to continue" symbol to be < let's say, and
you can use it as a cool icon, and a control character
[code:1edec5fs]
write text "this is an RPG dialog. press a to continue<"&newline&"and it wouldn't get to this part until after you pressed a, if you added the code:<"

on letter typed "<"
pause writing

on A pressed
resume writing
[/code:1edec5fs]
so you could have classic rpg dialogs that scroll to a certain point, then wait for input before they continue typing

that is all for today :)
glad to see interest around this again
I'll finish it this month yall
sorry again for the delay

and then when your mouse was over a word
Back to Top
1,643 Rep
Post Options Post Options   Quote konjak Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 2009 at 1:25pm
That sounds very good!

The method I'm used to is having symbols or the like written that have no width that cause a color UNTIL I write the symbol I use to stop coloring, would that work?

Same with pausing, I'd just use a zero width symbol several times over and it will be like a short pause, but then it continues (a hesitant pause, not wait for input).
Back to Top
11,225 Rep
Post Options Post Options   Quote lucid Quote  Post ReplyReply Direct Link To This Post Posted: 06 Aug 2009 at 7:20am
this isn't to tease
there's just to much to explain in the update for me to just upload
and not enough time before I leave to work to explain it now
but I have the possible final version ready
with all bugs and features currently on the tracker fixed or implemented, respectively

also a few bugs that weren't on there
I should be able to upload it tonight
Back to Top
11,225 Rep
Post Options Post Options   Quote lucid Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 12:20am

SpriteFont (Release Candidate)
[size=150:3qv8fi56]SpriteFont![/size:3qv8fi56]
includes simple "hello world" example cap

this is a very large plugin with alot of features, and will require good documentation
I will get to that as I can, however, for now you can play, and I check the forums several times a day, and I will gladly answer any questions you may have

Changelog:
BugFixes:
[list:3qv8fi56][*:3qv8fi56]Fixed Set Write Speed[/*:m:3qv8fi56]
[*:3qv8fi56]Fixed Several Crashes and Visual Errors with ScrollWrap[/*:m:3qv8fi56]
[*:3qv8fi56]Fixed Conditions not displaying icon on EventSheet[/*:m:3qv8fi56]
[*:3qv8fi56]Clear Text now clears text in memory as well as visually[/*:m:3qv8fi56][/list:u:3qv8fi56]

Features:
[list:3qv8fi56][*:3qv8fi56]Set Character Range by String (so you can say "AGHIF#$52" if your sprite frames are out [/*:m:3qv8fi56][*:3qv8fi56]of order, and you just want to specify the order with a string)[/*:m:3qv8fi56]
[*:3qv8fi56]Set Text Formatting properties in properties pane[/*:m:3qv8fi56]
[*:3qv8fi56]Scroll values now float instead of integer[/*:m:3qv8fi56]
[*:3qv8fi56]Added private variables[/*:m:3qv8fi56]
[*:3qv8fi56]Added pause writing, resume writing[/*:m:3qv8fi56]
[*:3qv8fi56]No longer necessary to Show Text after a scroll to update view[/*:m:3qv8fi56][/list:u:3qv8fi56]
Back to Top
4,734 Rep
Post Options Post Options   Quote UberLou Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 12:36am
Great job man! I've been waiting for an update for this so that I can add it to my game. I already have a font ready to go and I'm working on it right now. Thanks a lot for making this!
Back to Top
4,900 Rep
Post Options Post Options   Quote Davioware Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 1:32am
omg omg OMG! :mrgreen:

thanks for adding the set characters by string feature. Also, does the plugin work with 98.9
Back to Top
4,734 Rep
Post Options Post Options   Quote UberLou Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 1:51am
Wow this plugin works REALLY well. One problem I've come across though...is there any way to make sure the font draws at a rounded number position? Sometimes my font looks nice and crisp, other times its really blurry and I'm guessing its because its drawing at like (50.3, 70.1). Thanks!

edit: Found another bug. The bitmap font scrolls with the screen even when put on layers that have the Scroll Rate turned off.
Back to Top
11,225 Rep
Post Options Post Options   Quote lucid Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 8:15am
[quote="Davioware":1rxbx2t5]omg omg OMG! :mrgreen:

thanks for adding the set characters by string feature. Also, does the plugin work with 98.9[/quote:1rxbx2t5]
no prob. I believe it does work with 98.9. although I haven't tested it with 98.9
this is built with the 98.9 sdk

[quote="UberLou":1rxbx2t5]Wow this plugin works REALLY well. One problem I've come across though...is there any way to make sure the font draws at a rounded number position? Sometimes my font looks nice and crisp, other times its really blurry and I'm guessing its because its drawing at like (50.3, 70.1). Thanks!

edit: Found another bug. The bitmap font scrolls with the screen even when put on layers that have the Scroll Rate turned off.[/quote:1rxbx2t5]
thank you lou. could you show me a cap with the bluriness?,I wasn't able to reproduce it

I tried setting scroll to +0.5 pixels every 500 milliseconds, to make sure it was drawing not perfectly on a pixel, but if I looked closely I could still see each pixel crisply

as far as the scrolling goes, when you choose font sprite, it asks you which layer to draw the sprite font on, so thats where you choose which layer it should be on
EDIT: new version is up. you no longer have to set the layer manually
Back to Top
16,464 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 2009 at 8:20am
Yeah I think for ease of use it should default to where the object is. Better to drag and drop, than go back and forth between layout, and events.
Back to Top
 Post Reply Post Reply Page  <1 23456 21>

Forum Jump Forum Permissions View Drop Down