Get Started in 5 steps:
1. Download the VisualNovelJS files:
2. Add the files to your webpage:
3. Create the file "myVisualNovel.js" and add it to your webpage:
4. Open the created file (myVisualNovel.js), add the code below, and save it:
5. Add the div for your novel on the webpage
That's it! To learn more, view the examples or read the docs
Example code:
1. Download the VisualNovelJS files:
2. Add the files to your webpage:
<link type="text/css" rel="stylesheet" href="visaul-novel.min.css" /> <script type="text/javascript" src="visual-novel.min.js" ></script>
3. Create the file "myVisualNovel.js" and add it to your webpage:
<script type="text/javascript" src="myVisualNovel.js" ></script>
4. Open the created file (myVisualNovel.js), add the code below, and save it:
// Create Visual Novel: // HTML element id = getting-started-vn // Width = 800 // Height = 600 // Images location = img/ var vn = new VisualNovel( "getting-started-vn", 800, 600, "img/" ); vn.init(); // Title vn.setNovelTitle( "Visual Novel JS", "getting started" ); // Start screen settings vn.setStartScreenBgColor( "black" ); vn.setStartScreenMenuPos( 550, 500 ); // Background vn.setBgColor( "black" ); // Dialog settings vn.setDialogBgColor( "white" ); vn.setDialogTextColor( "black" ); vn.say( "Me", "Hello World" ); vn.say( "World", "Hi Me" ); // Go back to start screen vn.reset();
5. Add the div for your novel on the webpage
<div id="getting-started-vn"></div>
That's it! To learn more, view the examples or read the docs
Example code:
<script> var vn = new VisualNovel( "getting-started-vn", 800, 600, "img/" ); vn.init(); vn.setNovelTitle( "Visual Novel JS", "getting started", 300, 100 ); vn.setStartScreenBgColor( "black" ); vn.setStartScreenMenuPos( 550, 500 ); vn.setBgColor( "black" ); vn.setDialogBgColor( "white" ); vn.setDialogTextColor( "black" ); vn.say( "Me", "Hello World" ); vn.say( "World", "Hi Me"); vn.reset(); </script>
Config
Character
Say
Menu
Condition
Loop
Scene
Scene Text
Scene Object
Custom Events
Create a visual novel instance:
Set the novel title:
Set the start screen background color / image:
Set the start screen menu position:
Set the novel background color / image:
Set the dialog background color:
Set the dialog text color:
var vn = new VisualNovel( "getting-started-vn", // id of div html element 800, 600, // width, height "img/" // location of images );
Set the novel title:
vn.setNovelTitle( "Visual Novel JS", "getting started" );
Set the start screen background color / image:
vn.setStartScreenBgColor( "black" ); vn.setStartScreenBgImage( "bg/market.jpg", // path to image 800, 600 // width, height );
Set the start screen menu position:
vn.setStartScreenMenuPos( 400, 400 ); // x, y position
Set the novel background color / image:
vn.setBgColor( "black" ); vn.setBgImage( "bg/market.jpg", // path to image 800, 600, // background width, height "no-repeat", 800, 600 // background size css );
Set the dialog background color:
vn.setDialogBgColor( "white" );
Set the dialog text color:
vn.setDialogTextColor( "black" );
Basic examples:
Full Examples:
Resources:
Goal: simplify visual novel creation on a webpage
Features:
- character dialogs
- user input
- menu choices
- conditions
- basic animations ( fade, move )
- custom events
Proposed features:
- save / load state
- custom menus
- more animations
- music