Charlie,

To format code examples so they are viewable 
on https://talk.tiddlywiki.org/,
enclose the code portion of your post inside *triple backticks placed on 
separate lines*
*immediately before and after the code*, like this:

```
this content will appear as a code block
when viewed on https://talk.tiddlywiki.org/
```

-e



On Saturday, February 19, 2022 at 8:03:38 PM UTC-8 [email protected] wrote:

> This post might be better viewed in Google Groups 
> <https://groups.google.com/g/tiddlywiki/c/P0hfGQeRYwo>.
>
> 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:*
>
> [image: BlueSunshine.png]
>
> On Saturday, February 19, 2022 at 11:39:57 PM UTC-4 Charlie Veniot wrote:
>
>> This new sample showcases TiddlyWiki providing the GUI to interact with a 
>> running BASIC programming.
>>
>> So one-way (TiddlyWiki to BASIC) sharing/communication.
>>
>> Give the Sunshine Application 
>> <https://basicanywheremachine.neocities.org/LocalStoragePrototype.html#Sunshine%20Application>
>>  
>> a try.  Nothing fancy, just proof-in-the-pudding concept.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5f47820a-c386-46c0-925d-21d4916e1759n%40googlegroups.com.

Reply via email to