A list that supports indexing by element name, as a convenience, etc
lst[some_name] means the first element where element.name == some_name. The dict-like get method is provided.
Additionally, NamedElementList subclasses can use several hooks to control how their elements are stored or what is allowed as elements.
Same as list.insert, except indices may be names instead of ints.
Insert the new value after the position specified by index_or_name
For numerical indexes, the same as insert(index + 1, value). Useful when indexing by strings.
Move an item by the specified number of indexes
amount can be negative. For example, “move layer down” translates to layers.move(idx, -1)
The method will clamp out-of range amounts, so, for eample, lst.move(0, -1) will do nothing.
Hooks for subclasses:
- modification_context(*args, **kwds)[source]¶
Context in which all modifications take place.
The default implementation nullifies the modifications if an exception is raised.
Note that the manager may nest, in which case the outermost one should be treated as an atomic operation.
Provides a map attribute extracted from the object’s layer.
Provides size based on pixel_size and the map
Getter/setter for self.size[0]
Getter/setter for self.size[1]
Getter/setter for self.tile_size[0]
Getter/setter for self.tile_size[1]
Getter/setter for self.pixel_pos[0]
Getter/setter for self.pixel_pos[1]
Getter/setter for self.pos[0]
Getter/setter for self.pos[1]