bouncing_box.button module

A module that contains the class and functions for the Button.

class Button(pos)

Bases: object

This class contains all of the functions and variables that is used by the Button.

checkMouseButtonPos()

A function to check if the mouse is over the button.

Returns

If the mouse is over the button.

Return type

bool

dimensions = <Vector2(242, 40)>
draw(screen)

A function to draw the Button to the screen.

Parameters

screen (class pygame.Surface) – The screen to draw to.

getDimensions()

The Button Dimensions getter.

Returns

The Button’s dimensions..

Return type

class:pygame.math.Vector2

getHeight()

The Button height getter.

Returns

The Button’s height.

Return type

float

getPos()

The Button position getter.

Returns

The Button’s position.

Return type

class:pygame.math.Vector2

getWidth()

The Button width getter.

Returns

The Button’s width.

Return type

float

getX()

The Button x position getter.

Returns

The Button’s x position.

Return type

float

getY()

The Button y position getter.

Returns

The Button’s y position.

Return type

float

input(event)

A function to handle the Button’s input.

Returns

The input event.

Return type

class Event

mousePos = <Vector2(0, 0)>
pressedSprite = <Surface(242x40x32 SW)>
setPos(pos)

The Button position setter.

Parameters

pos (class:pygame.math.Vector2) – The new value of the Button’s position.

setX(x)

The Button x position setter.

Parameters

x (float) – The new value of the Button’s x position.

setY(y)

The Button y position setter.

Parameters

y (float) – The new value of the Button’s y position.

sprite = <Surface(242x40x32 SW)>