Skip to content
Hackusate_PvP edited this page Aug 4, 2023 · 15 revisions

Scenes

RenScene aka scenes is a class that resembles a frame in your game. Visual novel games unlike most games are just a more complicated slideshow. These slides are better known as scenes or frames. There are different types of scenes and more to come in the future. The most common type of scene is an image scene which is typically used for character dialogue. Image scene contains an image and text, text is optional but we'll get to that later down the road. The next type of scene is an intractable scene. I know that isn't actually a word but view it as a scene in which the player can interact (click) with. A good example of this type is a map or navigating through a location. The next type of scene is a animation scene which plays a video as the background.

Keep in mind each scene needs to be apart of a story.

ImageScene

Like said above a image scene contains an image which is the background image and text. image

ImageScene scene = new ImageScene("intro-scene-1", yuki, "Hello Ren!", new ImageLoader("story/intro/background1.png"));
story.addScene(scene); // Like said above you need to have a story created before you can add scenes.

Image scenes are very easy and there is typically no events tied to them. Image scenes end and start on their which is determined by your story.

InteractableScene

Interactable scenes are little different than image scenes as they are a little more complex. Typically interactable scenes are added to their own separate stories and they are event dependent. Event dependent means they require an event listener to end this type of scene. Just like image scenes they require a id and background image however you can add your own overlays to the frame. Overlays are typically extra elements such as another image, text, or even a button.

InteractableScene scene = new InteractableScene("map", new ImageLoader("story/map/map1.png"));
story.addScene(scene); // Like said above you need to have a story created before you can add scenes.

In order to move past an interactable scene you must have an event that can end the scene. For the above example we are using a map as an example. The scene will never end randomly and you will have to code a button on the map to trigger another scene or story.

@Listener
public void onMapButtonClick(ButtonClickEvent event) {
    Button button = event.getButton()
    if (button.getId().equalsIgnoreCase("map-button-1") {
        // In this example they clicked on a button overlay in the map. Lets start a new story that triggers a sequence of events for a character.
        Story story = YourRenJavaClass.getInstance().getStoryManager("chracter-event-1");
        story.start(); // This will start the character event stated above.
    }
}

That is an example on how you can end an interactable scene there are different ways to do it so get creative with it.

AnimationScene

This isn't done with this version of the wiki. Come back later when RenJava has a more stable release.

Clone this wiki locally