0
$\begingroup$

I am trying to create a message board that displays a series of up to five messages, each on a single line. Ideally, I would like to use a traditional "green text on black background" format, something like this: enter image description here

This is created using:

Dataset[messages,Background -> Black, ItemStyle-> Green]

where messages is just a simple string array.

The problem with this approach is that you can't control the displayed width of a Dataset, nor can you eliminate or re-color the horizontal white lines between rows (or so I believe).

I don't think TableForm can accomplish what I am trying to achieve, but maybe Grid would work.

Does anyone have any alternative suggestions (including better formatting ideas!)?

$\endgroup$
0

2 Answers 2

1
$\begingroup$
messages = {
  "You have insufficient fuel to reach that destination."
  , "Player 2 has deployed death-star weapon."
  , "Move North-East."
  , "Your last play cost 3 credits, 8 credits remaining."
  , "The game has started. You have 10 seconds."
  }

As a Graphics object:

Graphics[{Text[
   Framed[
    Style[
     Column[messages, Spacings -> 0.8]
     , 16, Green, FontFamily -> "Courier"
     ]
    , Background -> Black
    , FrameMargins -> {{12, 12}, {12, 12}}
    ]
   ]
  }
 , ImageSize -> {600, 200}
 ]

enter image description here

$\endgroup$
1
$\begingroup$

Grid works okay, but you'll have a bit of work to do on the formatting

messages = {"Hey", "You", "What's", "Up"};
Rasterize[
 Grid[Partition[messages, 1], Background -> Black, ItemStyle -> Green,
   ItemSize -> Max[StringLength[#] & /@ messages], Alignment -> Left]]

Output of above script.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.