KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TutorialScenario Class Reference

A TutorialScenario is a ScenarioModule with some added features that are useful for building tutorials or similar kinds of scenarios. A TutorialScenario comes with a builtin in finite state machine for running the scenario and displays "tutorial pages" in a GUI window alongside a picture of a friendly Kerbal instructor. You can take advantage of all these features by making your ScenarioModule a subclass of TutorialScenario. More...

Inheritance diagram for TutorialScenario:

Classes

class  TutorialFSM
 The TutorialFSM provides a convient interface for implementing the meat of your scenario logic through a finite state machine. The states of the state machine are "pages." More...
 
class  TutorialPage
 TutorialPages are the states in the TutorialFSM finite state machine. They extend the KFSMState class, which represents a class in a more general finite state machine, to add tutorial-related features like a Callback in which you draw the GUI of the tutorial page. More...
 

Public Member Functions

 TutorialScenario ()
 

Public Attributes

string guiSkinName
 
KerbalInstructor instructor
 Controls the animated image of the kerbal instructor. This object lets you make the instructor run various animations . More...
 
int instructorPortraitSize
 
string instructorPrefabName
 Set this string in OnAssetSetup to specify which instructor kerbal will appear in the tutorial window. The value "Instructor_Gene" gives Gene Kerman as the instructor. The default if you do not specify anything is Werner von Kerman. More...
 
RenderTexture instructorTexture
 
int textureBorderRadius
 
string tutorialArrowPrefabName
 

Protected Member Functions

void ClearArrows ()
 
TutorialArrow CreateArrow ()
 
void DeleteArrow (TutorialArrow arrow)
 
void Destroy (global::UnityEngine.Object obj)
 
virtual void OnAssetSetup ()
 Override this function to run some initialization code? More...
 
virtual void OnTutorialSetup ()
 Override this function to run some code as the tutorial is being set up. More...
 
void SetDialogRect (Rect r)
 Sets the location of the GUI window of the tutorial. More...
 

Protected Attributes

GameObject arrowPrefab
 
List< TutorialArrow > arrows
 
TutorialScenario.TutorialPage currentPage
 
TutorialScenario.TutorialFSM Tutorial
 The finite state machine that controls the progression of the tutorial. More...
 

Detailed Description

A TutorialScenario is a ScenarioModule with some added features that are useful for building tutorials or similar kinds of scenarios. A TutorialScenario comes with a builtin in finite state machine for running the scenario and displays "tutorial pages" in a GUI window alongside a picture of a friendly Kerbal instructor. You can take advantage of all these features by making your ScenarioModule a subclass of TutorialScenario.

See HarvesteR's example code in his forum article:

http://forum.kerbalspaceprogram.com/content.php/121-Writing-Tutorials-A-Demo-%28and-some-source-code%29

Constructor & Destructor Documentation

TutorialScenario.TutorialScenario ( )

Member Function Documentation

void TutorialScenario.ClearArrows ( )
protected
TutorialArrow TutorialScenario.CreateArrow ( )
protected
void TutorialScenario.DeleteArrow ( TutorialArrow  arrow)
protected
void TutorialScenario.Destroy ( global::UnityEngine.Object  obj)
protected
virtual void TutorialScenario.OnAssetSetup ( )
protectedvirtual

Override this function to run some initialization code?

virtual void TutorialScenario.OnTutorialSetup ( )
protectedvirtual

Override this function to run some code as the tutorial is being set up.

void TutorialScenario.SetDialogRect ( Rect  r)
protected

Sets the location of the GUI window of the tutorial.

Parameters
r

Member Data Documentation

GameObject TutorialScenario.arrowPrefab
protected
List<TutorialArrow> TutorialScenario.arrows
protected
TutorialScenario.TutorialPage TutorialScenario.currentPage
protected
string TutorialScenario.guiSkinName
KerbalInstructor TutorialScenario.instructor

Controls the animated image of the kerbal instructor. This object lets you make the instructor run various animations .

int TutorialScenario.instructorPortraitSize
string TutorialScenario.instructorPrefabName

Set this string in OnAssetSetup to specify which instructor kerbal will appear in the tutorial window. The value "Instructor_Gene" gives Gene Kerman as the instructor. The default if you do not specify anything is Werner von Kerman.

RenderTexture TutorialScenario.instructorTexture
int TutorialScenario.textureBorderRadius
TutorialScenario.TutorialFSM TutorialScenario.Tutorial
protected

The finite state machine that controls the progression of the tutorial.

string TutorialScenario.tutorialArrowPrefabName

The documentation for this class was generated from the following file: