Maicha / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Need ability to write to buffer with full colour #93

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm creating a roguelike. I need full colour support, and buffer support; I 
noticed that I can get full colour via Terminal, and buffer via Screen, but not 
both, simultaneously.

Right now, I try to draw the absolute minimum changed characters, because I get 
a LOT of drawing artefacts. 

Here are some proposals:

- New Screen.putString method with RGB foreground colour (eg. [255, 128, 0])
- Expose Screen.putChar (as protected), and extend ScreenCharacter to support 
RGB
- Expose Screen.backBuffer (as protected), and extend ScreenChar to support RGB

I don't know what else will work. Any of these will suffice for me.

Original issue reported on code.google.com by alibhai....@gmail.com on 28 Nov 2013 at 5:14

GoogleCodeExporter commented 9 years ago
Yes, full color support is missing in the Screen at the moment. I have it 
working in the next version but due to major re-organizing of the API, I have 
no guarantees on when it will be available. 

I think your best option right now is to copy the code in the Screen class 
(it's pretty self-sustaining) into a new custom class and make the necessary 
modifications there to support full color.

Original comment by mab...@gmail.com on 1 Dec 2013 at 1:50

GoogleCodeExporter commented 9 years ago
I will end up writing some throw-away code in this case. That's not so bad.

I'll try this. I don't know if it will work though; it seems that all the code 
flows around buffering end up requiring the standard eight colours. I'll update 
this ticket if I get stuck.

Original comment by alibhai....@gmail.com on 1 Dec 2013 at 2:47

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It seems like Screen only knows about ScreenCharacter, which knows about 
Terminal.Color. It's not simple to rework it for RGB. It seems my ideas were 
wrong.

What's the smallest necessary change to support buffered full-colour characters?

Original comment by alibhai....@gmail.com on 1 Dec 2013 at 10:24

GoogleCodeExporter commented 9 years ago
Yeah, it was a little bit trickier than I first though. Let me see if I can 
backport some code from 3.0.

Original comment by mab...@gmail.com on 6 Dec 2013 at 2:34

GoogleCodeExporter commented 9 years ago
If it's only for this ticket, don't bother. I can live with what I have for the 
time being.

Original comment by alibhai....@gmail.com on 6 Dec 2013 at 3:29

GoogleCodeExporter commented 9 years ago
I will +1 this just so you aren't the only person needing this feature!

Original comment by Krisman....@gmail.com on 30 Dec 2013 at 8:30

GoogleCodeExporter commented 9 years ago
Thanks :)

Original comment by alibhai....@gmail.com on 30 Dec 2013 at 1:35

GoogleCodeExporter commented 9 years ago
Any updates on this?

Original comment by alibhai....@gmail.com on 17 May 2014 at 2:37

GoogleCodeExporter commented 9 years ago
Yes, it's now finally possible in 3.0! Please give the latest 3.0 snapshot a go.

Original comment by mab...@gmail.com on 8 Jun 2014 at 9:20

GoogleCodeExporter commented 9 years ago
It sounds like 3.0 is still under development. Please let me know when you 
publish it to search.maven.org so that I can consume it.

My Java Roguelike fell off the table, but I will still work with you to get 
these issues resolved, since yours is pretty much the best console UI emulator 
I found.

Original comment by alibhai....@gmail.com on 8 Jun 2014 at 1:44

GoogleCodeExporter commented 9 years ago
Yep 3.0 is still under heavy development but the Terminal and Screen API is 
pretty stable at this point. If you don't want to build it from source, there's 
supposed to be some way to add Sonatypes snapshot repository to your maven 
project and pull it from there. I've lost the instructions though... There may 
be a -alpha build pushed to Maven central sometime in the near future though.

Original comment by mab...@gmail.com on 9 Jun 2014 at 1:00

GoogleCodeExporter commented 9 years ago
Sorry to be dense, but where can I get 3.0 from? I'm not keen to build Lanterna 
from source. I didn't see any downloads on Google Code either.

Original comment by alibhai....@gmail.com on 9 Jun 2014 at 7:29

GoogleCodeExporter commented 9 years ago
No package at the moment and Google Code has locked the download section so I 
can't upload anything. You'll need Maven to compile it from source, just git 
clone the repo and run "mvn install" in the base directory.

Original comment by mab...@gmail.com on 18 Jun 2014 at 2:02