I'm thinking of putting this in for a feature request, but just want to gauge if it is something everyone else would want or use.
So, when you need to know more about an AppGameKit command, you would press F1 while the command is highlighted in the code editor. This brings up the help doc for that command in the help tab to the left.
What I'm thinking is the same thing for our own functions. We could put a comment block just above or inside the function definition, and the studio editor could use that comment as a help doc for that function. Pressing F1 on the highlighted function name anywhere in code would bring up the function help in the same help tab just like normal help docs.
This code:
/* Sets the window properties.
Params:
title (string): The text that will display on the window title bar.
window_width (int): The width of the window in pixels.
window_height (int): The height of the window in pixels.
resolution_width (int): The virtual width of the screen.
resolution_height (int): The virtual height of the screen.
sync_rate (int): The desired frame rate of the application.
Returns:
None
*/
function display_setup(title as string, window_width as integer, window_height as integer, resolution_width as integer, resolution_height as integer, sync_rate as integer)
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle(title)
SetWindowSize(window_width, window_height, 0)
SetWindowAllowResize(1) // allow the user to resize the window
// set display properties
SetVirtualResolution(resolution_width, resolution_height) // doesn't have to match the window
SetOrientationAllowed(1, 1, 1, 1) // allow both portrait and landscape on mobile devices
SetSyncRate(sync_rate, 0) // 30fps instead of 60 to save battery
SetScissor(0, 0, 0, 0) // use the maximum available screen space, no black borders
UseNewDefaultFonts(1)
endfunction
OR
function display_setup(title as string, window_width as integer, window_height as integer, resolution_width as integer, resolution_height as integer, sync_rate as integer)
/* Sets the window properties.
Params:
title (string): The text that will display on the window title bar.
window_width (int): The width of the window in pixels.
window_height (int): The height of the window in pixels.
resolution_width (int): The virtual width of the screen.
resolution_height (int): The virtual height of the screen.
sync_rate (int): The desired frame rate of the application.
Returns:
None
*/
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle(title)
SetWindowSize(window_width, window_height, 0)
SetWindowAllowResize(1) // allow the user to resize the window
// set display properties
SetVirtualResolution(resolution_width, resolution_height) // doesn't have to match the window
SetOrientationAllowed(1, 1, 1, 1) // allow both portrait and landscape on mobile devices
SetSyncRate(sync_rate, 0) // 30fps instead of 60 to save battery
SetScissor(0, 0, 0, 0) // use the maximum available screen space, no black borders
UseNewDefaultFonts(1)
endfunction
would show in the help window as:
I believe this could be very useful. Is this something anyone else would like added?