How do you predefine an Enum/dropdown parameter in a custom block? If it’s even possible.
For the people who don’t know what I’m talking about here is an example:
All help is appreciated .
How do you predefine an Enum/dropdown parameter in a custom block? If it’s even possible.
For the people who don’t know what I’m talking about here is an example:
All help is appreciated .
@ARandomGuyOnMakeCode you can do it two ways:
param.defl="MyEnum.Value"
. here’s an example:enum MyEnum {
//% block="one"
One,
//% block="two"
Two
}
/**
* Custom blocks
*/
//% weight=100 color=#0fbc11 icon=""
namespace custom {
//% blockId=my_custom_block_id
//% block="here's an enum $value"
//% value.defl=MyEnum.Two
export function foo(value: MyEnum): void {
}
}
Thank you for the information. Much appreciated .