Setting up the Scene:

  1. Import the latest version of Book Reader to your project workspace in Unity.  If you are starting a new project, create a basic scene with a light, a plane, and a first person controller.
  2.  Add a BookReader script to an object in the scene, such as the camera. Add ‘flip’, ‘open’ and ‘close’ sounds to the new BookReader script and add a cursor icon if a custom cursor is required. All of these resources can be found in the BookReader Folder.
  3. Add an object to the scene, such as a book, and add the Book script to it. An example object can be found in Demo/Book/Book.
  4.  View the newly added Book script in the inspector. Set the size of pages to 1 and add a .txt file with any text of your choosing to element 0. Sample .txt files can be found at Demo/Book/chicken.txt
  5.  Drag and drop an image representing the page you wish to display onto the Page Texture slot on the Book script. You can use BookReader/Textures/page.png for this purpose.
  6.  Basic setup is complete. Press play. By default if the book object is in the centre of the camera and the left mouse button is clicked, the book will open. If it is a multipage book, clicking on the left hand side of the book will go back, and clicking on the right hand side will go forward. If something has gone wrong, have a look at the Demo scene for ideas.


Writing Content:

Book Reader reads text line-by-line from text files. As well as plain text, a number of commands can be given. All commands need to start on a new line of the text file in order to be recognized.

Text

  • If no commands are given, anything that is written on a new line will be considered text.
  • Example: Hello, you are reading a book.
  • You can add addition detail to plain text by using rich text. A full list of rich text commands can be found here: http://docs.unity3d.com/Manual/StyledText.html
  • Example: <i>Hello</i>, <color=#00ffffff>you</color> are reading a <b>book.</b>

/page

  • This command will start a new page regardless of whether the previous page is full.
  •  Example: /page

/image

  • This command, followed by an image name, will load on image from the resources folder onto the page.
  • Example: /image dog
  • If you wish to resize the image follow the name of the image with a percent size
  • Example: /image dog 200
  •  If you wish to change the alignment of the image just type left or right. The default is center.
  •  Example: /image dog 200 left

/title

  • This command, followed by some text, will centre the text and increase its size.
  •  Example:  /title Ancient Book of Lore

/list

  • This command, followed by some text, will create a dot point and decrease its size.
  • Example:  /list milk
                    /list cheese

/nonum

  •  If page numbers are turned on, this command turns the page number off for the current page.
  •  Example: /nonum