![]() ![]() Get or set the alpha/transparency of the entire spritelist. When draw is called, the method will just return without drawing. Visible ( bool) – Setting this to False will cause the SpriteList to notīe drawn. This can be useful when making spritelists in threadsīecause only the main thread is allowed to interact with Resources are created until the first draw call or initialize() Lazy ( bool) – (Advanced) Enabling lazy spritelists ensures no internal OpenGL It’s a suggestion for the maximum amount of sprites this listĬan hold. If noĪtlas is supplied the global/default one will be used.Ĭapacity ( int) – (Advanced) The initial capacity of the internal buffer. This parameter has no effect.Ītlas ( TextureAtlas) – (Advanced) The texture atlas for this sprite list. Spatial_hash_cell_size ( int) – The cell size of the spatial hash (default: 128) With static walls/platforms in large maps. In the SpriteList slower, but it will speed up collision detection Use_spatial_hash ( bool) – If set to True, this will make creating a sprite, and This needs to be profiled on aįor the advanced options check the advanced section in the When they are moved can be greater than what you save with List of moving sprites the cost of updating the spatial hash In technical terms collision checking is O(1) with spatial hashingĮnabled and O(N) without. This will make collision checking a lot faster. If the spriteslist are going to be used for collision it’s a good ![]() Sprites outside the viewport/window will not be rendered. To put things into perspective, a spritelistĬan contain tens of thousands of sprites without any issues. The spritelistĬontains many low level optimizations taking advantage of your The purpose of the spriteList is to batch draw a list of sprites.ĭrawing single sprites will not get you anywhere performance wiseĪs the number of sprites in your project increases. SpriteList ( use_spatial_hash = None, spatial_hash_cell_size = 128, is_static = False, atlas : TextureAtlas = None, capacity : int = 100, lazy : bool = False, visible : bool = True ) # Toggle table of contents sidebar Sprite Lists # arcade.SpriteList # class arcade. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |