text_input
This module defines the following constants:
- InputText options
- BGUI_INPUT_NONE = 0
- BGUI_INPUT_SELECT_ALL = 1
- BGUI_INPUT_DEFAULT = BGUI_INPUT_NONE
-
class bgui.text_input.TextInput(parent, name, text='', prefix='', font=None, pt_size=None, color=None, aspect=None, size=[0, 0], pos=[0, 0], sub_theme='', input_options=0, options=12)
Widget for getting text input
Parameters: |
- parent – the widget’s parent
- name – the name of the widget
- text – the text to display (this can be changed later via the text property)
- prefix – prefix text displayed before user input, cannot be edited by user (this can be changed later via the prefix property)
- font – the font to use
- pt_size – the point size of the text to draw
- color – color of the font for this widget
- aspect – constrain the widget size to a specified aspect ratio
- size – a tuple containing the width and height
- pos – a tuple containing the x and y position
- sub_theme – name of a sub_theme defined in the theme file (similar to CSS classes)
- options – various other options
|
-
add_animation(animation)
Add the animation to the list of currently running animations
Parameters: | animation – The animation |
-
children
The widget’s children
-
frozen
Whether or not the widget should accept events
-
move(position, time, callback=None)
Move a widget to a new position over a number of frames
Parameters: |
- positon – The new position
- time – The time in milliseconds to take doing the move
- callback – An optional callback that is called when he animation is complete
|
-
name
The widget’s name
-
on_active
The widget’s on_active callback
-
on_click
The widget’s on_click callback
-
on_enter_key
A callback for when the enter key is pressed while the TextInput has focus
-
on_hover
The widget’s on_hover callback
-
on_mouse_enter
The widget’s on_mouse_enter callback
-
on_mouse_exit
The widget’s on_mouse_exit callback
-
on_release
The widget’s on_release callback
-
parent
The widget’s parent
-
position
The widget’s position
-
select_all()
Change the selection to include all of the text
-
select_none()
Change the selection to include none of the text
-
size
The widget’s size
-
system
A reference to the system object
-
visible
Whether or not the widget is visible
-
z_index
The widget’s z-index. Widget’s with a higher z-index are drawn
over those that have a lower z-index