Below: BASIC program source code, Tiddler's TW code, and finally a sample image.
BASIC program:
`Screen 21
'
main_program_start:
gosub init_vals
gosub drawbackground
gosub drawbackgroundlines
gosub drawsun
gosub drawforegroundlines
do while true
sleep 1
action$ = GetLocalStorageItem("Sunshine_Action")
if action$ <> "" then
if action$ = "DrawBackground" then
gosub drawbackground
elseif action$ = "DrawBackgroundLines" then
gosub drawbackgroundlines
elseif action$ = "DrawSun" then
gosub drawsun
elseif action$ = "DrawForegroundLines" then
gosub drawforegroundlines
end if
SetLocalStorageItem("Sunshine_Action", "" )
end if
loop
end
'
init_vals:
s = 0.0625
SetLocalStorageItem("Sunshine_BackgroundColor", "0xffffdd")
SetLocalStorageItem("Sunshine_BackgroundLinesColor", "0xffcc33")
SetLocalStorageItem("Sunshine_SunColor", "0xff0000")
SetLocalStorageItem("Sunshine_ForegroundLinesColor", "0xffcc33")
return
drawbackground:
backgroundColor = val(GetLocalStorageItem("Sunshine_BackgroundColor"))
line(0,0)-(1280, 1024), backgroundColor, BF
sleep s
return
drawbackgroundlines:
backgroundLinesColor = val(GetLocalStorageItem("Sunshine_BackgroundLinesColor"))
for y = 0 to 1000 step 10
for x = 0 to 1300 step 15
line (0,0) - (x,y), backgroundLinesColor
next x
sleep s
next y
return
drawsun:
circle (100,100), 200, &hffffff, , , ,F
sunColor = val(GetLocalStorageItem("Sunshine_SunColor"))
circle (100,100), 200, sunColor, , , ,F
sleep s
return
drawforegroundlines:
backgroundLinesColor = val(GetLocalStorageItem("Sunshine_ForegroundLinesColor"))
for y = 0 to 1000 step 40
for x = 0 to 1300 step 60
line (0,0) - (x,y), backgroundLinesColor
next x
sleep s
next y
return`
Tiddler:
`\define my-actions(do_this)
<$macrocall $name=SetLocalStorageItem k=Sunshine_Action v=$do_this$/>
\end
* Notes
** First, start the BASIC program by clicking on the console below
*** The BASIC program will draw the default image, then wait for your instructions
** In Settings and Controls below, adjust colors of the four different layers, pressing draw the draw button for each layer in whatever order you like, knowing that whatever is drawn in each layer will overwrite whatever is in the are of that layers
<details><summary>Settings and Controls</summary>
<details><summary>Background</summary>
<$edit-text tiddler="$:/temp/Sunshine_App/background" field="color" type="color" default="#ffffdd" inputActions="<$macrocall $name=SetLocalStorageItem k=Sunshine_BackgroundColor v={{{ [[$:/temp/Sunshine_App/background]get[color]search-replace[#],[0x]] }}}/>"/>
<$button actions=<<my-actions DrawBackground>> >
Draw Background
</$button>
</details>
<details><summary>Background Lines</summary>
<$edit-text tiddler="$:/temp/Sunshine_App/backgroundlines" field="color" type="color" default="#ffcc33" inputActions="<$macrocall $name=SetLocalStorageItem k=Sunshine_BackgroundLinesColor v={{{ [[$:/temp/Sunshine_App/backgroundlines]get[color]search-replace[#],[0x]] }}}/>"/>
<$button actions=<<my-actions DrawBackgroundLines>> >
Draw Background Lines
</$button>
</details>
<details><summary>Circle</summary>
<$edit-text tiddler="$:/temp/Sunshine_App/sun" field="color" type="color" default="#ff0000" inputActions="<$macrocall $name=SetLocalStorageItem k=Sunshine_SunColor v={{{ [[$:/temp/Sunshine_App/sun]get[color]search-replace[#],[0x]] }}}/>"/>
<$button actions=<<my-actions DrawSun>> >
Draw Circle
</$button>
</details>
<details><summary>Foreground Lines</summary>
<$edit-text tiddler="$:/temp/Sunshine_App/foregroundlines" field="color" type="color" default="#ffcc33" inputActions="<$macrocall $name=SetLocalStorageItem k=Sunshine_ForegroundLinesColor v={{{ [[$:/temp/Sunshine_App/foregroundlines]get[color]search-replace[#],[0x]] }}}/>"/>
<$button actions=<<my-actions DrawForegroundLines>> >
Draw Foreground Lines
</$button>
</details>
</details>
<div style="width:670px;height:500px;">
<$tiddler tiddler={{Sunshine.BAS!!title}}>
{{ ||Basic Console Window Template }}
</$tiddler>
</div>`
Image created by the BASIC program, adjusted with the colors specified with TiddlyWiki widgets: