Page 1 of 1
Lua & Encoding?
Posted: Thu Sep 30, 2010 11:54 pm
by omicron
Hi guys,
I'm dicking around with a 'roguelike' game and need to use certain non-ascii characters in my output. These would be: ▟ █ ▛ ░ ▒ ◎ ▎▜ ▙ Д Ѯ Ѫ ҂ Ϡ etc. etc.
Now, I'm fairly new to LUA as I began coding this project in curses with Python, but I stumbled across this library and it seems pretty fantastic. I don't have a terribly large amount of experience with LUA and documentation seems to be pretty...sparse. I can't seem to find how to print these characters; I'm sure it's a dumb question, but help would be appreciated.
Cheers
Re: Lua & Encoding?
Posted: Fri Oct 01, 2010 12:02 am
by kikito
I think it is going to be easier if you just make tiny images of the characters you need, and then use images of those characters instead.
LÖVE handles images better than it handles fonts & text - specially if there are unicode chars involved.
So, if it's only 10 or 20 symbols, it will be just easier with images, or maybe one single image with quads.
Re: Lua & Encoding?
Posted: Fri Oct 01, 2010 6:26 pm
by Robin
What kikito says is not completely true, LÖVE handles fonts and text just fine... as long as you're using ASCII. It is something that we all want fixed, but it is a bit difficult, especially since Lua doesn't support Unicode at all.
kikito wrote:So, if it's only 10 or 20 symbols, it will be just easier with images, or maybe one single image with quads.
Or an
ImageFont.
Re: Lua & Encoding?
Posted: Sat Oct 02, 2010 12:24 am
by kikito
I just meant that right now, what he wanted to do was actually easier with just plain images - they will be easier to adjust 'pixel perfectly', for example.
Re: Lua & Encoding?
Posted: Sat Oct 02, 2010 12:47 am
by zac352
kikito wrote:I think it is going to be easier if you just make tiny images of the characters you need, and then use images of those characters instead.
LÖVE handles images better than it handles fonts & text - specially if there are unicode chars involved.
So, if it's only 10 or 20 symbols, it will be just easier with images, or maybe one single image with quads.
What about an image font?
Re: Lua & Encoding?
Posted: Sat Oct 02, 2010 12:56 am
by kikito
An image font could be a solution, but he would have to encode the non-ascii characters as ascii.
He would have to do something similar to what happens when you try to write on windows with the Widgets Font, where letter 'a' is a cloud and letter 'b' is a dog taking a piss (for example). He would have to remember that 'a' is the 'blocky thing' and 'b' is the 'line-like thing'. And he would have to change fonts if he wanted to output any real 'a' or 'b'.
Using images seems more straightforward for me. It also saves time for the future, if he ever wants to allow tilesets.