Skip to content

Commit

Permalink
Version 1.6
Browse files Browse the repository at this point in the history
Update to add speed to animated commands.
  • Loading branch information
sysl-dev committed Apr 3, 2021
1 parent 398cc2d commit b6a0c4c
Show file tree
Hide file tree
Showing 12 changed files with 1,102 additions and 664 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

example/.vscode/settings.json
Binary file removed example/example_15.love
Binary file not shown.
775 changes: 454 additions & 321 deletions example/library/slog-text.lua

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions example/longtext.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
return [[
Hello there, welcome to the library!
[swing=30]H[swing=20]e[swing=10]l[swing=5]l[swing=1]o[/swing] [shake=30]t[shake=20]h[shake=10]e[shake=00]r[shake=-30]e[/shake], [spin=10]w[spin=9]e[spin=8]l[spin=7]c[spin=5]o[spin=3]m[spin=0]e[/spin] [blink=1]t[blink=2]o[blink=2.5] t[blink=-3]h[blink=4]e[/blink] [raindrop=3]l[raindrop=2]i[raindrop=1]b[raindrop=0]r[raindrop=-1]a[raindrop=-2]r[raindrop=-3]y[raindrop=999]![/raindrop]
[font=earth_illusion][bounce=0][rainbow=3=100]Hello! Welcome [rainbow=10=-30]to [rainbow=20]the [rainbow=1]library![/rainbow][/bounce][/font]
This library will work with any font object that love can produce, and at any scale. So even if you don't use pixel art, this library will work for you!
Note, in order to apply all the effects and animate everything each character is a draw call. So if you have a lot of text, like a visual novel, it might be overkill.
[b]b[/b] - [b]Fake Bold[/b] [b]u[/b] - [u]Underline[/u] [b]dropshadow=[/b]# - Style [dropshadow=0]00 [dropshadow=1]01 [dropshadow=2]02 [dropshadow=3]03 [dropshadow=4]04 [dropshadow=5]05 [dropshadow=6]06 [dropshadow=7]07 [dropshadow=8]08 [dropshadow=9]09 [dropshadow=10]10[/dropshadow]
[b]b[/b] - [b]Fake Bold[/b] [b]u[/b] - [u]Underline[/u] [shadowcolor=#FF0000] [b]dropshadow=[/b]# - Style[font=earth_illusion] [dropshadow=0]00 [dropshadow=1]01 [dropshadow=2]02 [dropshadow=3]03 [dropshadow=4]04 [dropshadow=5]05 [dropshadow=6]06 [dropshadow=7]07 [dropshadow=8]08 [dropshadow=9]09 [dropshadow=10]10[/dropshadow][/font]
[b]i[/b] - [i]Fake Italics[/i] [b]s[/b] - [s]Strikethrough[/s] [b]mirror[/b] - [mirror]Print text backwards[/mirror] (Print Text Backwards) [b]rotate[/b]=# - [rotate=180]Rotate Text[/rotate] (Rotate Text)
[b]color[/b]=# - [color=20]Sets color, based on a palette table.[/color] [color=#AA2032]Or Hex #AA2032[/color] [b]font=font_name[/b] - [font=comic_neue]Change font ([b]B[/b] [i]I[/i] [u]U[/u] [s]S[/s])
[b]color[/b]=# - [color=20]Sets color, based on a palette table.[/color] [color=#AA2032]Or Hex #AA2032[/color] [b]font=font_name[/b] - [font=comic_neue]Change font ([b]B[/b] [i]I[/i] [u=-3]U[/u] [s=1]S[/s])
[/font][b]scale[/b]=# - [scale=2]Scale the text[/scale]
[b]shake[/b] - [shake]Shake Text[/shake] [b]bounce[/b] - [bounce]Bounce Text[/bounce]
[b]spin[/b] - [spin]Spin Text[/spin] [b]blink[/b] - [blink]Blink Text[/blink]
[b]swing[/b] - [swing]Swing Text[/swing] [b]rainbow[/b] - [rainbow]Raibow Text[/rainbow]
[b]raindrop[/b] - [raindrop]Rain Fall Text[/raindrop] [b]shader[/b] - [shader=x_gradient]Apply a shader for advanced text control - have fun![/shader]
[rainbow][bounce][shake]Combine them for more effects![/shake][/bounce][/rainbow] - (rainbow bounce shake)
[b]raindrop[/b] - [raindrop]Rain Fall Text[/raindrop] [b]shader[/b] - [shader=x_gradient]Apply a shader for advanced text control - have fun![/shader]
[rainbow=4=100][bounce][shake]Combine them for more effects![/shake][/bounce][/rainbow] - (rainbow bounce shake)
A note on Unicode characters:]
You must wrap extended characters like this: [|sp1]|[|è][|sp2]
Th[|è]n you can print it to your h[|è]arts d[|è]sir[|è].
A note on Unicode characters:
You can just use them!
Thèn you can print it to your hèarts dèsirè.
You can even wrap more than one character this way.
[|sp1]|[|ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçö][|sp2]
[rainbow][swing][|Tèxt] [|èffects][/swing] [shake][|work] [|too!] Cool [|è]h? [/shake][/rainbow]
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçö
[rainbow][swing]Tèxt èffects[/swing] [shake]work too! Cool èh? [/shake][/rainbow]
This will even work for other languages!
[font=shinonome_12][|こ][|ん][|に][|ち][|は][|!][/font][font=shinonome_14][|こ][|ん][|に][|ち][|は][|!][/font][font=shinonome_16][|こ][|ん][|に][|ち][|は][|!][/font]
[font=shinonome_12]こんにちは![/font][font=shinonome_14]こんにちは![/font][font=shinonome_16]こんにちは![/font]
You can even draw an image directly in the text!
[image=frame=default_8][image=frame=eb_8][image=frame=m3_8]
]]
14 changes: 7 additions & 7 deletions example/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ boptimer = 1,
function love.load()
-- Set up examples
-- Example 1 // Default Font // Examples
example1box = Text.new("left", { color = {1,1,1,1}, shadow_color = {0.5,0.5,1,0.4}})
example1box = Text.new("left", { color = {1,1,1,1}, shadow_color = {0.5,0.5,1,0.4}, default_underline_position = -2, default_strikethrough_position = 1})
example1box:send(example.long_text_block, 320*4, true)
-- Example 2 // Golden Apple Font // Earthbound Style Box
example2box = Text.new("left", { color = {1,1,1,1}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.golden_apple, character_sound = true})
example2box:send("[|•] Do you like eggs?[newline][|•] I think they are [pad=6]eggzelent![audio=sfx=laugh]", 100, false)
example2box:send(" Do you like eggs?[newline] I think they are [pad=6]eggzelent![audio=sfx=laugh]", 100, false)
-- Example 3 // Golden Apple Font // Mother 3 Style Bottom
example3box = Text.new("left", { color = {1,1,1,1}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.golden_apple, character_sound = false, print_speed = 0.02})
example3box:send("I am a very cute [color=#00ff00]green frog[/color]. Would you like to eat dinner with me? It's [rainbow][bounce]fresh[/bounce] [u]fly[/u] [shake]soup[/shake]![/rainbow]", 316, false)
Expand All @@ -166,13 +166,13 @@ example5box = Text.new("left", { color = {0.9,0.9,0.9,0.95}, shadow_color = {0.5
example5box:send("[dropshadow=3][function=example.ex5_textboxsize=64][textspeed=0.02]With the Power of Queens, they challenged the Snakes. Garry's mighty waves peeled apart their diamond scales. The Wizards woke[waitforinput][audio=sfx=ui] [function=example.ex5_textboxsize=example.ex5_textboxsize+16]mighty windstorms. Niza brought the deadly wine[waitforinput][audio=sfx=ui] [function=example.ex5_textboxsize=example.ex5_textboxsize+16]and cheese. [audio=sfx=ui]", 320-16, false)
--Example 6 // Comic Neue / Center Box
example6box = Text.new("left", { color = {0.9,0.9,0.9,0.95}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.comic_neue, character_sound = true, sound_every = 5, sound_number = 2})
example6box:send("Oh wow, you found the [bounce][rainbow]high-res[/rainbow][/bounce] text! [][icon=1][icon=2][icon=3][icon=4] [icon=5][icon=6][icon=7][icon=8] [icon=9][icon=10][icon=11][icon=12][/]", 320*4-16, true)
example6box:send("Oh wow, you found the [bounce][rainbow]high-res[/rainbow][/bounce] text! [icon=1][icon=2][icon=3][icon=4] [icon=5][icon=6][icon=7][icon=8] [icon=9][icon=10][icon=11][icon=12][/]", 320*4-16, true)
--Example 7 // Comic Neue Big / BoxBK Style
example7box = Text.new("left", { color = {0.9,0.9,0.9,0.95}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.comic_neue_big, character_sound = true, sound_every = 3, sound_number = 3})
example7box:send("[warble=-5][textspeed=0.02][][image=witch][pad=32]There's something I have to say,[pause=0.7][] [warble=5]this witch will save the day!", 320*4-16, false)
example7box:send("[warble=-5][textspeed=0.02][image=witch][pad=32]There's something I have to say,[pause=0.7] [warble=5]this witch will save the day!", 320*4-16, false)
--Example 8 // Comic Neue / Undertale Style
example8box = Text.new("left", { color = {0.9,0.9,0.9,0.95}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.comic_neue_small, character_sound = true, print_speed = 0.04, sound_every = 2, sound_number = 4})
example8box:send("[function=example.bop=true]Did you hear about the [color=#FF0000]bad puns?[/color][pause=0.5] You did?![pause=0.5] That's [color=#FFFF00]great[/color][pause=0.8]! [shake]Now I don't have to tell you about them![/shake][pause=1][][function=example.bop=false][][audio=sfx=laugh]", 320-80, false)
example8box:send("[function=example.bop=true]Did you hear about the [color=#FF0000]bad puns?[/color][pause=0.5] You did?![pause=0.5] That's [color=#FFFF00]great[/color][pause=0.8]! [shake]Now I don't have to tell you about them![/shake][pause=1][function=example.bop=false][audio=sfx=laugh]", 320-80, false)
end

--[[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------]]--
Expand Down Expand Up @@ -334,13 +334,13 @@ function love.keypressed( key, scancode, isrepeat )
end
if example.display_mode == 7 then
if key == "r" then
example7box:send("[warble=-5][textspeed=0.02][][image=witch][pad=32]There's something I have to say,[pause=0.7][] [warble=5]this witch will save the day!", 320*4-16, false)
example7box:send("[warble=-5][textspeed=0.02][image=witch][pad=32]There's something I have to say,[pause=0.7] [warble=5]this witch will save the day!", 320*4-16, false)

end
end
if example.display_mode == 8 then
if key == "r" then
example8box:send("[function=example.bop=true]Did you hear about the [color=#FF0000]bad puns?[/color][pause=0.5] You did?![pause=0.5] That's [color=#FFFF00]great[/color][pause=0.8]! [shake]Now I don't have to tell you about them![/shake][pause=1][][function=example.bop=false][][audio=sfx=laugh]", 320-80, false)
example8box:send("[function=example.bop=true]Did you hear about the [color=#FF0000]bad puns?[/color][pause=0.5] You did?![pause=0.5] That's [color=#FFFF00]great[/color]![pause=0.8] [shake]Now I don't have to tell you about them![/shake][pause=1][function=example.bop=false][audio=sfx=laugh]", 320-80, false)

end
end
Expand Down
Loading

0 comments on commit b6a0c4c

Please sign in to comment.