dot big bang

Developer API

Snow People Decorator

  • Public
  • Public/Protected
  • All

Snow People Decorator

Snow People Decorator is a remixable game that lets you take and use the snow people that appeared in the winter hub.

These make use of some scripts in the other examples that let you change the appearance of an object by interacting with it. The difference is the fancy new screen that appears to let you use buttons to make the changes rather than just cycling through in order or randomly.

Check it out and remix it here!

Some other reading that can help you understand how the appearance scripts work can be found here:

The Game

The game itself is meant to be remixed so you can take things from it to build your own stuff. The main focus in this game is the Snow People. To get your own copy of the game that you can edit just click the link to it above and hit the Remix button in the upper left.

If you play the game you will see several boxes laid out in the level. These explain how various aspects of the example work and you should read each one.

Editing the game will let you select a Snow Person or one of the Screen templates and investigate the scripts on those.

The Snow Person

If you select a Snow Person you will see several scripts. The first three are related to changing the appearance.

  • dbb_voxel_switcher - This handles most of the work under the hood and you don't need to modify it in any way. Just make sure you include it on any decoratable objects you want to make from these.
  • dbb_voxel_appearance_snowpeople - This has the sliders that get set based on the selections made on the screen. You can also just slide these around to set an appearance. You will probably want to remix thi script to make your own version with specific categories and numbers of options. Read the comments in the script to learn how to use it.
  • dbb_voxel_collection_snowpeople - This script is associated with the previous one and contains all of the references to the options. This is another script you will likely remix and adjust to fit your needs. Read the comments in the script to learn how to use it.

Next there is the Open Change Appearance Screen script. This script references a screen data that exists in a different object and associates the categories in the appearance scripts to icons on the screen.

The optional "Override Camera" property should be set to a Camera that is looking at the Snow Person since when the screen opens it will switch to this camera. This is meant to frame the object as you decorate it.

Property Names need to match the names you use in the appearance scripts to work properly.

Finally we use a dbb_gizmo script to hide the grey base object when the game starts.

The Screen

In order for the screen to work you need some other objects in the game.

First you need a Screen Manager to control the showing and hiding of the screen. You can use the Screen Manager in the example game as is.

You also need a Database that has a Screen Data script on it. This screen data defines how the screen behaves and references the screen template. Make sure that the Data Id is set to the same value as the one in the Open Change Appearance Screen script mentioned earlier.

Screen Template

The Screen itself is a template that doesn't stay in the game. Instead it is added to the game when the screen is opened and removed when closed. Select the "Decorate Snow Person Screen" object to see how this is set up.

Note: The example object in the game has the UI Controller script disabled so it doesn't always show when the game is running. Your final template will need to have the UI Controller script enabled.

The Change Appearance Screen UI script lets you define some data about the entry templates that it spawns. It spawns one entry per category and each entry has an icon with previous and next arrows on it. It also lets you set some layout properties.

The remaining scripts are all UI related and they create the visual appearance of the screen. Check out UI Controller for more information on how this system works.

Screen Entry Template

The screen spawns in several "Decorate Snow Person Screen Entry" templates. Selecting this object will show you a similar setup to the screen.

The Change Appearance Screen Entry UI script lets you set references to the various UI element scripts on the object. If you change an "Element Id" property on any of the UI scripts you will need to update the reference here.

The UI Scripts are exactly like the screen.