-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Description
Hello!
I've been experimenting with CC:C Bridge to render progress bars on Create displays. First off, thank you for making this integration — it works really well!
While testing, I noticed that progress bar characters drawn via Lua appear tightly packed, whereas native Create progress bars have a visible pixel gap between blocks, which looks much cleaner (as seen in the attached picture).
After some investigation, it seems this behavior is likely due to how the display size is reported via the getSize() method: each Create display block contributes 4 characters wide × 2 characters high, and CC:C Bridge seems to add an extra column (width = blocks × 4 + 1). This may explain why characters appear to “overlap” when drawn side by side.
Here’s an example snippet of how I currently draw a bar in Lua:
local source = peripheral.find("create_source")
source.clear()
-- I found the right characters by reading in a create progress
-- bar via the CC:C Bridge Source Block
local FULL = string.char(167) -- full character
local EMPTY = string.char(127) -- empty/dotted character
local function drawBar(display, y, percent)
local width, _ = display.getSize()
local filled = math.floor(width * percent + 0.5)
display.setCursorPos(1, y)
display.write(string.rep(FULL, filled) .. string.rep(EMPTY, width - filled))
end
drawBar(source, 2, 0.65) -- 65% filledWith this, the bar works, but the characters overlap with each other by just a bit (as seen in the attached picture) without the nice spacing seen in native Create bars.
I think it would be fantastic if there were a way to replicate the native pixel spacing in progress bars, either as a rendering option in CC:C Bridge or via a “spacing character” adjustment.
Thank you for considering this enhancement!