Construction Functions

These functions are independent of the various levels or main world screeen and simply make it easier to add items to panels or windows.

Functions

makeSimplePanel(p1, p2, drawPlane[, tag, ...]) Creates a simple panel.
createPanelLine(panel, point1, point2[, c, lw]) Draws a line to a panel.
createPanelText(panel, x, y, text[, c, fS, ...]) Draws text to a panel.
createLoadButton(panel, x, y, w, h, text, tag) Draws a load button to a panel.
createPanelButton(panel, x, y, w, h, text, tag) Draws a button to a panel.
createNextButton(panel, x, y, w, h, text, tag) Draws a ‘next’ button to a panel.

Details

makeSimplePanel(p1, p2, drawPlane, tag='panel', color=color, clickFunction=None, visible=True)[source]

Creates a simple panel.

A Simple panel is simply a rectangle with a black border, usually with some on click function attached to it.

Parameters:
  • p1 – Tuple (x, y) indicating the coordinate for the top left of the panel.
  • p2 – Tuple (x, y) indicating the coordinate for the bottom right of the panel.
  • drawPlaneShape that this panel should be drawn to.
  • colorColor indicating the background color for this panel.
  • clickFunctiononClick() callback function to be executed when this panel is clicked.
  • visible – boolean indicating whether this panel should be visible.
createPanelLine(panel, point1, point2, c=color, lw=None)[source]

Draws a line to a panel.

Parameters:
  • panelRectangle that the line will be drawn to.
  • point1 – Tuple (x, y) indicating the coordinate where the line should start.
  • point2 – Tuple (x, y) indicating the coordinate where the line should end.
  • cColor of the line.
  • lw – float indicating the width of the line.
createPanelText(panel, x, y, text, c=color, fS=18, yJust=None)[source]

Draws text to a panel.

Parameters:
  • panelRectangle that the text will be drawn to.
  • x – float indicating the x coordinate of the text.
  • y – float indicating the y coordinate of the text.
  • text – string indicating the text to be drawn.
  • cColor of the text.
  • fS – integer indicating the font size of the text.
  • yJust – string indicating the vertical alginment of the text. Options are: “top”, “bottom”, or “center”. Default is “bottom”.
createLoadButton(panel, x, y, w, h, text, tag, avatar=None, buttonColor=color, textColor=color, fS=18, leftIcon=None, timeStamp=None)[source]

Draws a load button to a panel.

Parameters:
  • panelRectangle that the text will be drawn to.
  • x – float indicating the x coordinate of the text.
  • y – float indicating the y coordinate of the text.
  • w – float indicating the width of the button.
  • h – float indicating the height of the button.
  • text – string indicating the text to be shown on the button.
  • tag – string used to identify the action to be performed when this button is clicked.
  • avatarPicture to be shown on the button.
  • buttonColorColor of the background of the button.
  • textColorColor of the text of the button.
  • fS – integer indicating the font size of the text.
  • leftIconPicture to be shown at the left side of the button.
  • timeStamp – value is ignored.
createPanelButton(panel, x, y, w, h, text, tag, avatar=None, buttonColor=color, textColor=color, fS=18)[source]

Draws a button to a panel.

Parameters:
  • panelRectangle that the text will be drawn to.
  • x – float indicating the x coordinate of the text.
  • y – float indicating the y coordinate of the text.
  • w – float indicating the width of the button.
  • h – float indicating the height of the button.
  • text – string indicating the text to be shown on the button.
  • tag – string used to identify the action to be performed when this button is clicked.
  • avatarPicture to be shown on the button.
  • buttonColorColor of the background of the button.
  • textColorColor of the text of the button.
  • fS – integer indicating the font size of the text.
createNextButton(panel, x, y, w, h, text, tag, buttonColor=color, textColor=color, fS=18, shape='rectangle')[source]

Draws a ‘next’ button to a panel.

The ‘next’ button is a button shown on the SpeechBox that indicates whether there are still responses left within the current conversation. If there are still responses left, the ‘next’ button is triangular. If there are no responses left, the ‘next’ button is a rounded rectangle.

Parameters:
  • panelRectangle that the text will be drawn to.
  • x – float indicating the x coordinate of the text.
  • y – float indicating the y coordinate of the text.
  • w – float indicating the width of the button.
  • h – float indicating the height of the button.
  • text – string indicating the text to be shown on the button.
  • tag – string used to identify the action to be performed when this button is clicked.
  • buttonColorColor of the background of the button.
  • textColorColor of the text of the button.
  • fS – integer indicating the font size of the text.
  • shape – string indicating the shape of the button. Options are: “rectangle” and “triangle”.