hello_world.js 774 B

12345678910111213141516171819202122232425262728293031
  1. let plugin = plugin_create();
  2. let h0 = ui_handle_create();
  3. let h1 = ui_handle_create();
  4. let h2 = ui_handle_create();
  5. let h3 = ui_handle_create();
  6. let h4 = ui_handle_create();
  7. let h5 = ui_handle_create();
  8. let h6 = ui_handle_create();
  9. plugin_notify_on_ui(plugin, function() {
  10. if (ui_panel(h0, "My Plugin")) {
  11. ui_text("Label");
  12. ui_text_input(h1, "Text Input");
  13. if (ui_button("Button")) {
  14. console_info("Hello");
  15. }
  16. ui_row([1 / 2, 1 / 2]);
  17. ui_button("Button A");
  18. ui_button("Button B");
  19. ui_combo(h2, ["Item 1", "Item 2"], "Combo");
  20. ui_row([1 / 2, 1 / 2]);
  21. ui_slider(h3, "Slider", 0, 1, true);
  22. ui_slider(h4, "Slider", 0, 1, true);
  23. ui_check(h5, "Check");
  24. ui_radio(h6, 0, "Radio 1");
  25. ui_radio(h6, 1, "Radio 2");
  26. ui_radio(h6, 2, "Radio 3");
  27. }
  28. });