F
Finn
Guest
When I create a sprite from a surface and then add subimages from the surface they appear in the texture pages as individual texture pages - one complete texture page for each subimage of the sprite added (see screenshots below). Is this intended? Seems like a performance nightmare.
What might be happening (not sure) is that GMS create a texture page every time a sprite_create_from_surface or sprite_add_from_surface gets called as it cant alter the previously created ones. This seems very inefficient though.
DETAILS:
The test sprite I want to create with the code should show the subimages "1", "2", "3", "4", ..., "8" - instead they appear each as individual texture pages and each multiple times.
The actual complete sprite I am trying to create does _NOT_ appear in any of the texture pages.
Any ideas why this would happen? My understanding is that GMS will create one new texture page for the sprite and its subimages.
Btw: In the example code of the function sprite_add_from_surface() is a typo. It should read "_i*32" as an argument where it calls the function.
EDIT: I forgot to say the sprite and its subimages work in game as intended. The 29 redundant texture pages for a single sprite seem like a performance nightmare though and not as it was intended.
I M A G E S
What might be happening (not sure) is that GMS create a texture page every time a sprite_create_from_surface or sprite_add_from_surface gets called as it cant alter the previously created ones. This seems very inefficient though.
DETAILS:
The test sprite I want to create with the code should show the subimages "1", "2", "3", "4", ..., "8" - instead they appear each as individual texture pages and each multiple times.
The actual complete sprite I am trying to create does _NOT_ appear in any of the texture pages.
Any ideas why this would happen? My understanding is that GMS will create one new texture page for the sprite and its subimages.
Btw: In the example code of the function sprite_add_from_surface() is a typo. It should read "_i*32" as an argument where it calls the function.
EDIT: I forgot to say the sprite and its subimages work in game as intended. The 29 redundant texture pages for a single sprite seem like a performance nightmare though and not as it was intended.
I M A G E S
- Code:
-
- Sprite I want to create
-
-
Last edited by a moderator: