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(columns=40, rows=40, tile_size=1, tile_margin=0, background_image=None)[source]
borders(value)[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.

Return type

list

get_tokens_at_rect(rect)[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.

Return type

list