Skip to content

Commit

Permalink
Updates to library for changing character width
Browse files Browse the repository at this point in the history
See example 10!
  • Loading branch information
sysl-dev committed Jul 15, 2023
1 parent 9f30c71 commit 369499a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/library/slog-text.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local m = {
debug = false,
_NAME = 'SYSL-Text',
_VERSION = '1.9',
_VERSION = '2.0',
_DESCRIPTION = 'Fancy Text System',
_URL = 'https://github.com/SystemLogoff',
_LICENSE = [[
Expand Down
4 changes: 2 additions & 2 deletions example/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ example8box:send("[function=example.bop=true]Did you hear about the [color=#FF00
example9box = 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})
example9box:send("Hello! Welcome to the world of Pocket Creatures![waitforinput][scroll][newline]My name is Professor Tree![newline][waitforinput][scroll][scroll]And you are?", 150, false)
example10box = Text.new("left", { color = {0.9,0.9,0.9,0.95}, shadow_color = {0.5,0.5,1,0.4}, font = Fonts.monogram_extended_custom, character_sound = false, keep_space_on_line_break=true, modify_character_width_table = {["j"] = -1, }})
example10box:send("Special Sheep Polution Test, Bahhh:\n\nij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij\n\na a a a a a a a a a a a a a a a a a a a a a a a a\n\nI've dropped so many letters oh no!", 540, true)
example10box:send("Special Sheep Polution Test, Bahhh:\n\nij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij ij\n\na a a a a a a a a a a a a a a a a a a a a a a a a\n\nI've dropped so many letters oh no!\nOjan Pjan Ajan Testj Characterj oj mh wj ikj applej orangej colaj Martijn..", 540, true)
end

--[[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------]]--
Expand Down Expand Up @@ -305,7 +305,7 @@ if example.display_mode == 10 then
love.graphics.draw(images.bg)
Screen.stop()
love.graphics.setColor(0,0,0,1)
love.graphics.rectangle("fill",0,0,540, 300)
love.graphics.rectangle("fill",0,0,540, 540)
love.graphics.setColor(1,1,1,1)
example10box:draw(0,0)
end
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
![Quick Demo of Examples](/screenshots/ex.gif?raw=true "Quick Demo of Examples")

# Update Notes
* New: You can now pass a table to modify character widths, in case your font does something like move the j or q in one pixel. (See example 10)
* New: You can now pass tables to the Audio/Font/Image/Etc commands if you don't keep resources global
* New ```[scroll]``` command, will scroll the text up by line-height or a set value. Works well with ```love.graphics.setScissor```.
* You have access to the basic calculated width, height and linecount for each textbox. Access is under the ```get``` table.
- ```my_cool_textbox.get.width, my_cool_textbox.get.height, my_cool_textbox.get.lines ```
Expand Down

0 comments on commit 369499a

Please sign in to comment.