-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|686|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
mike_g
Created : 05 March 2007
Edited : 05 March 2007
Language : Blitz

Scrolling LED text



Heres some code for scrolling LED-like text I just finished. It shouldent be too hard to add to programs. Theres still a bit of tweaking I want to do to it but other than that its pretty much finished


|edit| Oh yeah and I forgot to mention that it cant deal with meta-characters yet. If you try and use them in the text the prog will crash. |edit|

 

Comments


Tuesday, 06 March 2007, 00:00
shroom_monk
Wow, Nice!
Tuesday, 06 March 2007, 05:47
mike_g
Glad you like it
Wednesday, 07 March 2007, 01:07
Agent
Nice, but not exactly what I was expecting.
I thought it would be an LED matrix which simulates the scrolling effect by switching individual LEDs on and off, just like the actual hardware displays do.

I might have a go at programming it, just to show what I mean.
Wednesday, 07 March 2007, 02:26
mike_g
Cool, it would be good to see what you come up with

Yeah my version doesent really simulate LED displays, it just looks a bit like one. All the graphics in my version get pre-drawn to an image, because its faster than drawing stuff each loop. The downside to this is that there cant be any animation, or colour changing. Which you may have expected would have been possible.

I'm probably going to re-code this as the image can become very big which seems to cause problems on some computers.
Wednesday, 07 March 2007, 09:45
garand

Friday, 09 March 2007, 18:48
Agent
mike_g,
Just to give an idea of the effect I was talking about..


Saturday, 10 March 2007, 04:39
mike_g
Thats cool. It looks more like a real LED display. Thanks for posting it

Out of curiousity, how would I be able to work out this:

would be displayed as a 0?
Saturday, 10 March 2007, 05:55
Agent
Yeah, sorry about the lack of comments.

It's just the 5x7 bit pattern packed into a string:

01110 = 14, 14 + 95 = 109, 109 = Asc('m')
10001 = 17, 17 + 95 = 112, 112 = Asc('p')
10011 = 19, 19 + 95 = 114, 114 = Asc('r')
10101 = 21, 21 + 95 = 116, 116 = Asc('t')
11001 = 25, 25 + 95 = 120, 120 = Asc('x')
10001 = 17, 17 + 95 = 112, 112 = Asc('p')
01110 = 14, 14 + 95 = 109, 109 = Asc('m')
Saturday, 10 March 2007, 09:48
mike_g
Thanks for the explanation, makes sense now. Saves on quite a bit of code too, cheers.
Saturday, 10 March 2007, 10:40
shroom_monk
Yeah, that's a clever way of storing the information, Agent Smith!
Saturday, 10 March 2007, 17:39
Agent
Cheers, shroom_monk

I decided to port my little LED program to Cobra..



Holy cow! The speed of Pure2D just blows Blitz's Oval function out of the water. I had to put in a delay, or avoid blinking
Sunday, 11 March 2007, 05:13
mike_g
Nice conversion. In order to get it to work I had to change the constants SPACING, and BANNER to variables. Looks like it must be fixed in the full version, but the demo still seems to have a few problems with constants.

As to do with drawing stuff, I also noticed that Cobra seems fast compared to Blitz even with the debugger on. I converted some vector graphics stuff I made in Blitz and so far I have been quite impressed with it. I'll post some of the code a bit later on.
Sunday, 11 March 2007, 06:31
Agent
That's interesting. Thanks for trying out my code, but I didn't realize you weren't using the full version. If you're finding the demo faster than Blitz, I don't think you'll be disappointed with the speed of the full version (if you decide to buy it).

I haven't downloaded the Cobra2D beta yet, I'm still just playing around with Pure2D and getting familiar with the language.
|edit| The Cobra2D unit has just been included in the latest update patch for the full release |edit|