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.
- drawPlane –
Shapethat this panel should be drawn to. - color –
Colorindicating the background color for this panel. - clickFunction –
onClick()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: - panel –
Rectanglethat 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.
- c –
Colorof the line. - lw – float indicating the width of the line.
- panel –
-
createPanelText(panel, x, y, text, c=color, fS=18, yJust=None)[source]¶ Draws text to a panel.
Parameters: - panel –
Rectanglethat 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.
- c –
Colorof 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”.
- panel –
-
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: - panel –
Rectanglethat 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.
- avatar –
Pictureto be shown on the button. - buttonColor –
Colorof the background of the button. - textColor –
Colorof the text of the button. - fS – integer indicating the font size of the text.
- leftIcon –
Pictureto be shown at the left side of the button. - timeStamp – value is ignored.
- panel –
-
createPanelButton(panel, x, y, w, h, text, tag, avatar=None, buttonColor=color, textColor=color, fS=18)[source]¶ Draws a button to a panel.
Parameters: - panel –
Rectanglethat 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.
- avatar –
Pictureto be shown on the button. - buttonColor –
Colorof the background of the button. - textColor –
Colorof the text of the button. - fS – integer indicating the font size of the text.
- panel –
-
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
SpeechBoxthat 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: - panel –
Rectanglethat 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.
- buttonColor –
Colorof the background of the button. - textColor –
Colorof 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”.
- panel –