It looks like you're new here. If you want to get involved, click one of these buttons!
local myLog = LogWindow.new({ -- log window using custom options x = 25, y = 25, width = 400, lines = 16, color = 0x555566, alpha = 0.75, font = myFont, textColor = 0xeeddee, textAlpha = 0.8, }) myOtherLog = LogWindow.new() -- another log window using all default values myLog:toFront() -- bring log window to front myLog:append("here is some text <img class="emoji" src="https://forum.giderosmobile.com/resources/emoji/smile.png" title=":)" alt=":)" height="20" />") -- print some text to the log myLog:clear() -- clear the log myLog:append("this text is green", 0x55bb55) -- print some colored text to the log myLog:append("This is line1|This is line2|This is line 3") -- print multiple lines to log myOtherLog:show(false) -- hide the other log |
Likes: pie, totebo, hgy29, n1cke, rolfpancake
Comments
One thing to point out with this version is that because it now buffers any text you append to it, you will need to clear it periodically so you don't run out of RAM on your device. You can use count() to determine how many lines are currently bufered and if you think it's too many then you can call clear() to clear the text area.
Maybe I will add some inbuilt buffer management but for now it's functional.
Likes: rolfpancake
This is my old Chat class and it's no longer supported because of my new GUI system. It also has some flows and it's code need to be rewritten a bit. Other than that it's worth a look.
Likes: antix, rolfpancake
@n1cke i am pointing out again, i cant wait to see your new Gui system and chat class also seems so much usefull.
And @antix new history addition and ability to write in different colors are also perfect additions.
I am sure both classes have already answered to lots of needs. As myself i will check both of them on Monday and will decide which one to use.
Thanks again guys.
Likes: antix, n1cke
Thanks for your logwindow class. I wanted to make it responsive. Is this the right way to do so?
-- Edit:
I want to add something:
The common newline identifier is "\n" instead of "/n". Is there a reason to use "/"? (see http://lua-users.org/wiki/StringsTutorial for reference)
I also found a bug where something strange happened after scrolling an entire page. That's resolved. It's looking really good now, thanks @rolfpancake for the great ideas
LogWindow also now only redraws the textlines once it has scrolled an entire line, before it redrew every pixel scrolled.
Oh, I also changed the /n's to \n's
Likes: talis, rolfpancake
Comment #2: This is so good it makes me want to cry happy tears.
It needs to live on Github with a spotlight on it, not hidden away in this forum thread. Or maybe included in the official Gideros repository.
Likes: antix
There's still a few more little things I might add to it. Does anyone else have any ideas?
Likes: totebo
Likes: antix, keszegh, pie
https://deluxepixel.com
Likes: SinisterSoft
btw i at least did not use bitops, here it is for comparison:
Likes: SinisterSoft, antix
Fragmenter - animated loop machine and IKONOMIKON - the memory game