This project have been deprecated and might no longer work with the latest version of the Wonderland Engine.
An updated version of this feature can be found in the PP library.
How annoying can it be to tune the value of a variable, put the headset on, test if the value is ok, removing the headset, tune it again and repeat? Well it's annoying even to write this to be honest.
Gladly, the Easy Tune is here to help! Now u can easily edit a value at runtime and avoid wasting 90% of the time removing the headset. Be immersed while you tune <3
You can find a live version of the Easy Tune here.
- Tune a variable at runtime
- Specify a new variable to add to the Easy Tune widget
- Easily switch between variables
- Show and hide the Easy Tune
- Choose your handedness
- Use it with hand tracking
- Pin the Easy Tune
- Be immersed
- You can use the thumbstick to increase/decrease the value
- If you press the squeeze button, you can use the thumbstick to change variable
- You can show and hide the Easy Tune by pressing Bottom + Top buttons
- You can click on the value to reset it
- You can click on the step to reset it
- You can pin the widget through the little
P
button - You can specify a variable as the one that should be selected as first when the game is executed
- You just have to specify the name inside the
easy_tune.js
script - You must be sure that the variable is created before the start method is called to use this trick
- You just have to specify the name inside the
- Use the
PP.SetEasyTuneWidgetActiveVariable
function to specify the active variable- This way you don't have to select it every time you start the app
To import the Easy Tune you have to:
- Import the
pp
folder into yourproject
folder, along with all the subfolders- This
pp
folder should only contain thepp.js
file, apart for other folders - You must link this folder in the Java Script Sources list (under Project Settings) before any other folders that contain scripts that use the
PP
namespace - This is needed to make sure the
PP
namespace is created before it is used - If you put it as first (after
/js/components/
) you should be safe
- This
- Add the
easy-tune
component to an object- You can add it to one of the hands object to have it on your wrist
_myHandedness
: this optimize the rotation and local position of the Easy Tune based on how you want to use it_myShowOnStart
: specify if the Easy Tune will be visible right from the start_myShowVisibilityButton
: specify if you want to show the little visibility button_myPlaneMaterial
: create a new Flat material from the resources editor panel and add it here- to set it as Flat you have to create a new temp mesh object and edit the material from there
- after creating it you may need to restart the engine
_myTextMaterial
: set this toDefaultFontMaterial
- Add the
tool-cursor
component to one of your hands object_myHandedness
: specify which hands is being used_myPulseOnHover
: specify if you want the gamepad to pulse on hover_myShowFingerCursor
: specify if you want to show the finger cursor for hand tracking, useful if you don't have a mesh on the hand_myCursorMesh
: set this toPrimitiveSphere
_myCursorMaterial
: set this to the same Flat material created above
- Gamepad
- If you want the gamepad extra features you will need to import it too
- Extra features include
- Use thumbstick to easily edit the values
- Hide and show the Easy Tune with Bottom + Top buttons
- You can find a guide on how to import the gamepad here
- Font
- The Easy Tune has been tested using the
courier_new
font - You can find it inside the
assets
folder - It can be set as the project font from the Project Settings
- Luckily the default font does its job too
- The Easy Tune has been tested using the
You can see an example on how to use the easy tune for your own variables inside the magic_sphere.js
script.
The steps are pretty simple:
- Add the variable to the Easy Tune Variables like this:
PP.EasyTuneVariables.addVariable(new PP.EasyTuneNumber("Magic Sphere X", 0, 0.5, 4))
- You can do this anytime, but if you add them on
init
you can specify it as the first variable selected (explained in the Tricks section)
- You can do this anytime, but if you add them on
- When u want to use that variable u just write
PP.EasyTuneVariables.get("Magic Sphere X").myValue
- At this point u just tune the variable at runtime
- When u have found a value that fits, u just write it down and overwrite the Easy Tune Variable with the plain value you have found
The Easy Tune supports the following types:
- Number
- You create it as follow:
PP.EasyTuneVariables.addVariable(new PP.EasyTuneNumber("Number 1", 7.3, 0.5, 4))
- The first parameter is the default value
- The second parameter is the default step
- The third parameter is the number of decimal places
- You create it as follow:
- Integer
- You create it as follow:
PP.EasyTuneVariables.addVariable(new PP.EasyTuneInteger("Integer 1", 3, 1))
- The first parameter is the default value
- The second parameter is the default step
- You create it as follow:
- Bool
- You create it as follow:
PP.EasyTuneVariables.addVariable(new PP.EasyTuneBool("Bool 1", true))
- The first parameter is the default value
- You create it as follow:
Adding new types is as simple as creating the widget to edit them, since after that you just need to attach it to the Easy Tune Widget.
Just look at how the Easy Tune Number Widget is implemented if you want to try!
You are free to use this in your projects, just remember to credit me somewhere!
Oculus Quest Controller Models by Jezza3D on Sketchfab with small adjustments made by me.