the Decentralan builder is very basic for now and it's a bit painful to work with. These utilities will allow you to create groups, shift one entity or the whole group by a certain amount, rotate, import and export your projects and more.
check the DCLBuilder.js
file
for the API and the usage examples
or see some examples further down
if you want to computationally control the Decentraland builder entities, (without reliying on the SDK) you can use these functions. I imagine one day they will be made available inside the builder itself. Until then you can use these helpers. Some screenshots of algorithmic projects built for the Decentraland Builder contest ( read more about the submissions).
It can be very helpful to use if you have to add more parcels to recenter all the entities without painfully having to move them by hand.
- requires React Developer Tools for Chrome
(you need to be able to use
$r
in the browser's console for the script to work)
- open the browser developer tools > Sources > Snippets
- create a new snippet
- copy & paste the content of the
src/DCLBuilderUtils.js
in the browser console
- open the browser on https://builder.decentraland.org
- open any project
- open the React tab in the chrome developer tools (only if you installed the extension)
- then open the console and verify that
$r
is notundefined
- if it works open the DCLBuilder snippet and execute it (command+enter on mac)
- this will automatically perform the
init()
function and output some useful information about the project in the console. - all functions are avaialable under the namespace
D
so you can quickly access them likeD.getSelectedEntity()
now you have some useful functions to manipulate the entities in the builder.
Read the DCLBuilder.js
for the API os see some examples here
Demo1 - Shift All by amount
Demo2 - Group with conditions
Demo3 - Duplicate Group
ETH tips and tokens 🙏 : 0x9820909256A4f636322066f75b984899f1c3aa2f