Board.PixelBoard

PixelBoard is a child class of Board

classDiagram Board <|-- PixelBoard Board <|-- TiledBoard class Board{ } class PixelBoard{ } class TiledBoard{ }

PixelBoard

class miniworldmaker.boards.pixel_board.PixelBoard(*args, **kwargs)[source]
borders(value: Union[tuple, miniworldmaker.board_positions.board_position.BoardPosition, pygame.Rect])list[source]

Gets all borders a rect is touching

Parameters

rect – The rect

Returns: A list of borders, e.g. [“left”, “top”, if rect is touching the left an top border.

get_tokens_at_rect(rect: pygame.Rect, singleitem=False, exclude=None, token_type=None)Union[miniworldmaker.tokens.token.Token, list][source]

Returns all tokens that collide with a rectangle.

Parameters
  • rect – A rectangle

  • token_type – The class of the tokens which should be added

  • singleitem – Should the return type be a single token (faster) or a list of tokens(slower)

  • exclude – A token which should not be returned e.g. the actor itself

Returns

If singleitem = True, the method returns all tokens colliding with the rect of the given token_type as list. If singleitem = False, the method returns the first token.

remove_from_board(token: miniworldmaker.tokens.token.Token)[source]

removes a token from board. The method is called with token.remove()

Parameters

token – The token to remove from board.

Returns: