Bored, made an LED number display. It does use
Advanced 2D plugin. DBP project and images included in attached zip file.
REM **************************************
REM Title: LED Display
REM Author: Phaelax
REM Created: Monday, March 11, 2013
REM **************************************
rem led image numbers range from this value to +9
#CONSTANT LED 1
rem load images
for i = 0 to 9
load image "led_"+str$(i)+".png", LED+i
next i
sync on
sync rate 60
do
cls
rem background visual
box 0, 0, screen width(), screen height(),0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFFFF00FF
showLed(mousex(), mousey(), 8, 0.64, timer()/100, rgb(0,240,0))
sync
loop
REM ****************************************
REM X,Y - Position to draw LED graphic
REM Length - Number of digits to display
REM Scale - 1.0 = 100 pixel height
REM Value - Actual number value to display
REM Color - Color of LED display
REM ****************************************
function showLed(x, y, length, scale as float, value, color as dword)
v$ = str$(value)
l = len(v$)
spacing = 58*scale
offset = (length-l-1)*spacing
shadow = 2
rem background digits
for i = 0 to length-1
a2DrawImage LED+8, x+i*spacing+shadow, y+shadow, 0, 0, 0, scale, 0, 0x33000000
next i
rem active digits
for i = 1 to l
d = val(mid$(v$, i))
a2DrawImage LED+d, offset+x+i*spacing, y, 0, 0, 0, scale, 0, color
next i
endfunction
"You're all wrong. You're all idiots." ~Fluffy Rabbit