Difference between revisions of "BootOpts.grfon"

From MiniScript Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
<c>bootOpts.grfon</c> is a file which [[Mini Micro]] looks for upon startup, which controls several options about the appearance and behavior of the machine.  You may want to tweak and include this file when [[How to package a Mini Micro game|packaging your game for distribution]].
+
''bootOpts.grfon'' is a file which [[Mini Micro]] looks for upon startup, which controls several options about the appearance and behavior of the machine.  You may want to tweak and include this file when [[How to package a Mini Micro game|packaging your game for distribution]].
  
 
The file is a plain text file in [http://luminaryapps.com/blog/announcing-grfon-a-kinder-gentler-serialization-format/ GRFON] format, which basically means key:value pairs surrounded by whitespace and comments.  Here are the keys supported.
 
The file is a plain text file in [http://luminaryapps.com/blog/announcing-grfon-a-kinder-gentler-serialization-format/ GRFON] format, which basically means key:value pairs surrounded by whitespace and comments.  Here are the keys supported.
Line 31: Line 31:
  
 
== Custom Keys ==
 
== Custom Keys ==
All the key-value pairs in the <c>bootOpts.grfon</c> file are also loaded into the <c>[[env]]</c> global map as <c>env.bootOpts</c>.  You may add your own custom key-value pairs to the file, and then look them up in <c>env.bootOpts</c> at runtime.
+
All the key-value pairs in the ''bootOpts.grfon'' file are also loaded into the <c>[[env]]</c> global map as <c>env.bootOpts</c>.  You may add your own custom key-value pairs to the file, and then look them up in <c>env.bootOpts</c> at runtime.
  
 
== Example ==
 
== Example ==

Revision as of 15:48, 7 April 2020

bootOpts.grfon is a file which Mini Micro looks for upon startup, which controls several options about the appearance and behavior of the machine. You may want to tweak and include this file when packaging your game for distribution.

The file is a plain text file in GRFON format, which basically means key:value pairs surrounded by whitespace and comments. Here are the keys supported.

Key Default Value Meaning
startupChime true Whether to play the startup chime when the machine boots
welcome true Whether to show the welcome text (including a handy tip!) on boot
queryCmd true Whether to allow a "cmd=" query parameter (web builds only)
controlC true Whether to allow control-C to interrupt a running program
diskSlots true Whether to show disk slots below the screen (desktop builds only)
logoSticker true Whether to show the "Mini Micro" sticker below the screen
hasBezel true Whether to have a bezel around the screen at all
bezelImage 3DBezel.png 3DBezel.png, FlatBezel.png, or the name of your own PNG file
bezelTint #FFFFFF tint color to apply to the bezel image (in HTML color format, no alpha)
loadingTint #FFFFFFFF color for the "loading, please wait image" (alpha OK)

A reasonable bootOpts.grfon file is included in the StreamingAssets folder of the WebGL template.

Custom Keys

All the key-value pairs in the bootOpts.grfon file are also loaded into the env global map as env.bootOpts. You may add your own custom key-value pairs to the file, and then look them up in env.bootOpts at runtime.

Example

// Machine options (read when Mini Micro boots, before disks are loaded).

// Whether to play the startup chime when the machine boots.
startupChime: true

// Whether to show the welcome text (including a handy tip!) on boot.
welcome: true

// Whether to allow a "cmd=" query parameter (web builds only).
queryCmd: true

// Whether to allow control-C to interrupt a running program.  CAUTION:
// if you set this to false, and your program enters an infinite loop,
// then your only recourse will be to restart Mini Micro.
controlC: true

// Whether to show the disk slots in the bezel below the screen.
// NOTE: this is ignored in web builds (where disk slots are never shown).
diskSlots: true

// Whether to show the "Mini Micro" sticker in the lower-right corner of the bezel.
logoSticker: true

// Whether to have a bezel at all.  Note that if you set this to false, then
// you will get no disk slots or logo sticker regardless of the settings above.
hasBezel: true

// What image to use for the bezel.  This can be the name of one of the
// built-in bezels ("3DBezel.png" or "FlatBezel.png"), or the name of a
// PNG file located in the Streaming Assets folder next to this file.
bezelImage: ScratchedBezel.png

// Tint color for the bezel.  Specify in HTML color format (same as Mini Micro
// color literals): #RRGGBB, where RR, GG, and BB are hex values from 00 to FF.
// Leave unspecified to get the standard Mini Micro beige bevel.
// Note that alpha is not supported.
//bezelTint: #8888FF

// Color to use for the "loading, please wait" image
// (use #00000000 if you don't want it to show at all).
loadingTint: #FFFFFF