NotQuiteParadise2

Utility

angle_to(start_pos: pygame.math.Vector2, end_pos: pygame.math.Vector2) float[source]

Find the angle to another position.

clamp(value: nqp.core.utility._V, min_value: nqp.core.utility._V, max_value: nqp.core.utility._V) nqp.core.utility._V[source]

Return the value, clamped between min and max.

clip(surface, x, y, x_size, y_size) pygame.Surface[source]

Clip a subsurface from a surface.

distance_to(start_pos: pygame.math.Vector2, end_pos: pygame.math.Vector2) float[source]

Find the distance to another position.

get_direction(angle: float, move_distance: float) pygame.math.Vector2[source]

Find the direction based on the angle and distance

grid_down(selected: int, width: int, height: int)[source]
grid_left(selected: int, width: int, height: int)[source]
grid_right(selected: int, width: int, height: int)[source]
grid_up(selected: int, width: int, height: int)[source]
itr(iterable)[source]

An iteration tool for easy removal.

lerp(initial_value: float, target_value: float, lerp_fraction: float) float[source]

Linear interpolation between initial and target by amount. Fraction clamped between 0 and 1. >=0.99 is treated as 1 to handle float imprecision.

next_number_in_loop(start: int, loop_size: int) int[source]
offset(list_: List, offset_, offset_mult=1)[source]
percent_to_float(percent_string: str)[source]

Convert string representation of percent into a float

previous_number_in_loop(start: int, loop_size: int) int[source]

If at max loop size, returns loop size -1.

scene_to_scene_type(scene) nqp.core.constants.SceneType[source]

Take a Scene and return the relevant SceneType

swap_colour(img, old_c, new_c)[source]