Skip to content

Latest commit

 

History

History
257 lines (248 loc) · 11.3 KB

Scripting.md

File metadata and controls

257 lines (248 loc) · 11.3 KB

Blocks Scripting Interface  

[TOC]

Plugin Bindings

void Plugin::RegisterMenuItem(const String&, const String&);
void Plugin::RegisterPropertyPage(const String&, const String&);
void Plugin::RegisterAction(const String& grp, const String& name, const String& msg, const String& eventID);

Editor Bindings

void Editor::AddSelection(Object);
void Editor::ClearSelection();
void Editor::Deselect(Object);
Scene Editor::GetActiveScene();
ImGuiElement@ Editor::GetImGui();
Scene Editor::GetMasterScene();
Object Editor::GetSelected(uint);
uint Editor::GetSelectionCount();
void Editor::Select(Object);
void Editor::ShowModalWindow(const String&, const String&);
void Editor::ShowToolWindow(const String&, const String&);

##DearIMGUI Bindings

The majority of the DearIMGUI library is bounds to Angelscript for use.

class ImGuiTextFilter { // NOT CONSTRUCTIBLE!
    bool PassesFilter(const String&);
};

void ImGui::AlignTextToFramePadding();
bool ImGui::Begin(const String&, bool, int = 0);
bool ImGui::BeginChild(const String&);
bool ImGui::BeginChildFrame(uint, const Vector2&, int = 0);
bool ImGui::BeginCombo(const String&, const String&, int = 0);
bool ImGui::BeginDock(const String&);
void ImGui::BeginGroup();
bool ImGui::BeginMainMenuBar();
bool ImGui::BeginMenu(const String&, bool = true);
bool ImGui::BeginMenuBar();
bool ImGui::BeginPopup(const String&, int = 0);
bool ImGui::BeginPopupContextItem(const String& = String ( ), int = 1);
bool ImGui::BeginPopupContextVoid(const String& = String ( ), int = 1);
bool ImGui::BeginPopupContextWindow(const String& = String ( ), int = 1, bool = true);
bool ImGui::BeginPopupModal(const String&, bool& = null, int = 0);
void ImGui::BeginTooltip();
void ImGui::Bullet();
void ImGui::BulletText(const String&);
bool ImGui::Button(const String&, Vector2 = Vector2 ( 0 , 0 ));
void ImGui::CalcListClipping(int, float, int&, int&);
Vector2 ImGui::CalcTextSize(const String&, const String& = String ( ), bool = false, float = - 1.0f);
void ImGui::CaptureKeyboardFromApp(bool = true);
void ImGui::CaptureMouseFromApp(bool = true);
bool ImGui::Checkbox(const String&, bool&);
bool ImGui::CheckboxFlags(const String&, uint&, uint);
void ImGui::CloseCurrentPopup();
bool ImGui::CollapsingHeader(const String&);
bool ImGui::CollapsingHeader(const String&, bool&);
bool ImGui::ColorButton(const String&, Color);
bool ImGui::ColorEdit3(const String&, Color&);
bool ImGui::ColorEdit4(const String&, Color&);
bool ImGui::ColorPicker3(const String&, Color&);
bool ImGui::ColorPicker4(const String&, Color&);
void ImGui::Columns(int = 1, const String& = String ( ), bool = true);
bool ImGui::Combo(const String&, int&, const Array<String>);
bool ImGui::DragFloat(const String&, float&, float = 1.0f, float = 0.0f, float = 0.0f);
bool ImGui::DragFloat2(const String&, Vector2&);
bool ImGui::DragFloat3(const String&, Vector3&);
bool ImGui::DragFloat4(const String&, Vector4&);
bool ImGui::DragFloatRange2(const String&, float&, float&, float = 0.0f, float = 1.0f);
bool ImGui::DragInt(const String&, int&, int = 0, int = 0);
bool ImGui::DragInt2(const String&, IntVector2&, int = 0, int = 0);
bool ImGui::DragInt3(const String&, IntVector3&, int = 0, int = 0);
bool ImGui::DragIntRange2(const String&, int&, int&, int, int);
void ImGui::Dummy(Vector2);
void ImGui::End();
void ImGui::EndChild();
void ImGui::EndChildFrame();
void ImGui::EndCombo();
void ImGui::EndDock();
void ImGui::EndGroup();
void ImGui::EndMainMenuBar();
void ImGui::EndMenu();
void ImGui::EndMenuBar();
void ImGui::EndPopup();
void ImGui::EndTooltip();
String ImGui::GetClipboardText();
int ImGui::GetColumnIndex();
float ImGui::GetColumnOffset(int = - 1);
float ImGui::GetColumnWidth(int = - 1);
int ImGui::GetColumnsCount();
Vector2 ImGui::GetContentRegionAvail();
float ImGui::GetContentRegionAvailWidth();
Vector2 ImGui::GetContentRegionMax();
Vector2 ImGui::GetCursorPos();
float ImGui::GetCursorPosX();
float ImGui::GetCursorPosY();
Vector2 ImGui::GetCursorScreenPos();
Vector2 ImGui::GetCursorStartPos();
int ImGui::GetFrameCount();
float ImGui::GetFrameHeight();
float ImGui::GetFrameHeightWithSpacing();
uint ImGui::GetID(const String&);
Vector2 ImGui::GetItemRectMax();
Vector2 ImGui::GetItemRectMin();
Vector2 ImGui::GetItemRectSize();
int ImGui::GetKeyIndex(int);
int ImGui::GetKeyPressedAmount(int, float, float);
int ImGui::GetMouseCursor();
Vector2 ImGui::GetMouseDragDelta(int = 0, float = - 1.0f);
Vector2 ImGui::GetMousePos();
Vector2 ImGui::GetMousePosOnOpeningCurrentPopup();
float ImGui::GetScrollMaxX();
float ImGui::GetScrollMaxY();
float ImGui::GetScrollX();
float ImGui::GetScrollY();
float ImGui::GetTextLineHeight();
float ImGui::GetTextLineHeightWithSpacing();
float ImGui::GetTime();
float ImGui::GetTreeNodeToLabelSpacing();
Vector2 ImGui::GetWindowContentRegionMax();
Vector2 ImGui::GetWindowContentRegionMin();
float ImGui::GetWindowHeight();
Vector2 ImGui::GetWindowPos();
float ImGui::GetWindowRegionWidth();
Vector2 ImGui::GetWindowSize();
float ImGui::GetWindowWedth();
void ImGui::Image(uint, Vector2);
void ImGui::Indent(float = 0.0f);
bool ImGui::InputFloat(const String&, float&);
bool ImGui::InputFloat2(const String&, Vector2&);
bool ImGui::InputFloat3(const String&, Vector3&);
bool ImGui::InputFloat4(const String&, Vector4&);
bool ImGui::InputInt(const String&, int&);
bool ImGui::InputInt2(const String&, IntVector2&);
bool ImGui::InputInt3(const String&, IntVector3&);
bool ImGui::InputText(const String&, String&);
bool ImGui::InputTextMultiline(const String&, String&);
bool ImGui::InvisibleButton(const String&, Vector2);
bool ImGui::IsAnyItemActive();
bool ImGui::IsAnyItemHovered();
bool ImGui::IsItemActive();
bool ImGui::IsItemClicked(int = 0);
bool ImGui::IsItemHovered(int = 0);
bool ImGui::IsItemVisible();
bool ImGui::IsKeyDown(int);
bool ImGui::IsKeyPressed(int, bool = true);
bool ImGui::IsKeyReleased(int);
bool ImGui::IsMouseClicked(int, bool = false);
bool ImGui::IsMouseDoubleClicked(int);
bool ImGui::IsMouseDown(int);
bool ImGui::IsMouseDragging(int = 0, float = - 1.0f);
bool ImGui::IsMouseHoveringRect(const Vector2&, const Vector2&, bool = true);
bool ImGui::IsMousePosValid(const Vector2&);
bool ImGui::IsMouseReleased(int);
bool ImGui::IsPopupOpen(const String&);
bool ImGui::IsRectVisible(const Vector2&);
bool ImGui::IsRectVisible(const Vector2&, const Vector2&);
bool ImGui::IsWindowAppearing();
bool ImGui::IsWindowCollapsed();
bool ImGui::IsWindowFocused(int = 0);
bool ImGui::IsWindowHovered(int = 0);
void ImGui::LabelText(const String&, const String&);
bool ImGui::ListBoxHeader(const String&);
bool ImGui::MenuItem(const String&, const String& = String ( ), bool = false, bool = true);
bool ImGui::MenuItem(const String&, const String&, bool&, bool = true);
void ImGui::NewLine();
void ImGui::NextColumn();
void ImGui::OpenPopup(const String&);
bool ImGui::OpenPopupOnItemClick(const String& = String ( ), int = 1);
void ImGui::PopClipRect();
void ImGui::PopID();
void ImGui::PopItemWidth();
void ImGui::ProgressBar(float);
void ImGui::PushClipRect(const Vector2&, const Vector2&, bool);
void ImGui::PushID(const String&);
void ImGui::PushID(int);
void ImGui::PushItemWidth(float);
bool ImGui::RadioButton(const String&, bool);
bool ImGui::RadioButton(const String&, int&, int);
void ImGui::ResetMouseDragDelta(int = 0);
void ImGui::SameLine(float = 0.0f, float = - 1.0f);
bool ImGui::Selectable(const String&, bool = false);
void ImGui::Separator();
void ImGui::SetClipboardText(const String&);
void ImGui::SetColumnOffset(int, float);
void ImGui::SetColumnWidth(int, float);
void ImGui::SetCursorPos(Vector2);
void ImGui::SetCursorPosX(float);
void ImGui::SetCursorPosY(float);
void ImGui::SetCursorScreenPos(Vector2);
void ImGui::SetItemAllowOverlap();
void ImGui::SetItemDefaultFocus();
void ImGui::SetKeyboardFocusHere(int = 0);
void ImGui::SetMouseCursor(int);
void ImGui::SetNextTreeNodeOpen(bool);
void ImGui::SetNextWindowCollapsed(bool);
void ImGui::SetNextWindowContentSize(Vector2);
void ImGui::SetNextWindowFocus();
void ImGui::SetNextWindowPos(Vector2);
void ImGui::SetNextWindowSize(Vector2, bool = false);
void ImGui::SetScrollFromPosY(float, float = 0.5f);
void ImGui::SetScrollHere(float = 0.5f);
void ImGui::SetScrollX(float);
void ImGui::SetScrollY(float);
void ImGui::SetTooltip(const String&);
void ImGui::SetWindowCollapsed(bool);
void ImGui::SetWindowCollapsed(const String&, bool);
void ImGui::SetWindowFocus();
void ImGui::SetWindowFocus(const String&);
void ImGui::SetWindowFontScale(float);
void ImGui::SetWindowPos(Vector2);
void ImGui::SetWindowPos(const String&, Vector2);
void ImGui::SetWindowSize(Vector2);
void ImGui::SetWindowSize(const String&, Vector2);
bool ImGui::SliderFloat(const String&, float&, float = 0.0f, float = 0.0f);
bool ImGui::SliderFloat2(const String&, Vector2&, float, float);
bool ImGui::SliderFloat3(const String&, Vector3&, float, float);
bool ImGui::SliderFloat4(const String&, Vector4&, float, float);
bool ImGui::SliderInt(const String&, int&, int = 0, int = 0);
bool ImGui::SliderInt2(const String&, IntVector2&, int = 0, int = 0);
bool ImGui::SliderInt3(const String&, IntVector3&, int = 0, int = 0);
bool ImGui::SmallButton(const String&);
void ImGui::Spacing();
void ImGui::Text(const String&);
void ImGui::TextColored(Color, const String&);
void ImGui::TextWrapped(const String&);
void ImGui::TreeAdvanceToLabelPos();
bool ImGui::TreeNode(const String&);
void ImGui::TreePop();
void ImGui::TreePush(const String&);
void ImGui::Unindent(float = 0.0f);
void ImGui::Value(const String&, bool);
void ImGui::Value(const String&, float);
void ImGui::Value(const String&, int);
void ImGui::Value(const String&, uint);

ImGuiUX

Several extensions have been written for ImGui usage, to avoid any confusion these have been placed into the ImGuiUX namespace.

bool ImGuiUX::EditVariant(const String& id, Variant& value);
bool ImGuiUX::AutoMenu(const String&);
void ImGuiUX::AutoSeparator();
void ImGuiUX::BeginTabBar(const String&, int);
bool ImGuiUX::Bitmask(const String&, uint&);
void ImGuiUX::CheckAutoSeparator();
void ImGuiUX::EndAutoMenu();
void ImGuiUX::EndTabBar();
bool ImGuiUX::MenuButton(const String&, const String&, const String&);
void ImGuiUX::PopFont();
void ImGuiUX::PushBoldFont();
void ImGuiUX::PushLargeBoldFont();
bool ImGuiUX::RangeSliderFloat(const String&, Vector2&, const Vector2&);
bool ImGuiUX::RangeSliderFloat(const String&, float&, float&, float, float);
void ImGuiUX::StandardPopupChecks();
bool ImGuiUX::TabItem(const String&, bool&, int);
bool ImGuiUX::ToggleButton(const String&, bool&);