hearing the "copy/paste into email" feature in the trailer and i thought to
save a step or 2?
// Project: MailTo
// Created: 2023-04-07
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "MailTo" )
SetWindowSize( 640,360, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 640,360 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Type Data
Name$, Minutes
EndType
GLOBAL Recipient$, CC$, Subject$, Body$, GameData as Data []
Recipient$ = "email@here.net"
CC$ = Recipient$
Subject$ = "Today's Game: " + GetCurrentDate()
Body$ = FillData(10)
GLOBAL EmailBUT = 1
AddVirtualButton(EmailBUT,400,40,40)
SetVirtualButtonText(EmailBUT,"Email")
do
If GetVirtualButtonPressed(EmailBUT) then Email()
Print(Subject$)
For x = 0 to GameData.Length
Print(GameData[x].Name$ + ":" + STR(GameData[x].Minutes))
Next x
Sync()
loop
Function EMail()
OpenBrowser("mailto:"+Recipient$+"?"+"cc="+CC$+"&subject="+Subject$+"&body="+Body$)
EndFunction
Function FillData(num)
ThisBody$ = ""
ThisData as Data
For x = 1 to num
ThisData.Name$ = "Name"+STR(x)
ThisData.Minutes = Random(1,10)
GameData.Insert(ThisData)
ThisBody$ = ThisBody$ + ThisData.Name$ + ":" + STR(ThisData.Minutes) + "%0A" //"new line"
Next x
EndFunction ThisBody$
(limited experience with building the url (had to find the equivalent to CHR(10) (%0A)) but tested fine on WIN & Android)
i expect you could also save the data to a file ( .ToJSON?) and attach that to an email similarly or upload it somewhere.
meanwhile, good luck with the app. i'm sure many will find it useful.
with that, this would be a stellar example of a non-game app to feature in the
AGK Showcase.