mazoku Posted July 24, 2014 Share Posted July 24, 2014 I want to ask a question about using game atlas. So you have an image in it and you create a sprite and set frame to the actual image in the spritesheet. So what part of the spritesheet is copied into memory? The whole thing or only the part that is our frame? Link to comment Share on other sites More sharing options...
lewster32 Posted July 24, 2014 Share Posted July 24, 2014 The whole spritesheet is kept in memory, but this is preferential unless you don't actually use a large part of the spritesheet, as otherwise you'd end up using pretty much the same amount of memory in individual sprites, but with the added overhead of having to load them individually. Regardless, the benefits of having an atlas when it comes to the huge performance gains in webGL, as well as the minor gains in loading speed when not make it well worth while. Link to comment Share on other sites More sharing options...
mazoku Posted July 24, 2014 Author Share Posted July 24, 2014 So if you have many small objects you will have the same spritesheet over and over copied in memory? Link to comment Share on other sites More sharing options...
lewster32 Posted July 24, 2014 Share Posted July 24, 2014 No, you will only have one. In webGL, all objects will share the same single texture in memory. I'm pretty sure basically the same is true of canvas, in that the portions that are needed are copied directly to the game canvas, rather than creating intermediate canvases for each sprite. Link to comment Share on other sites More sharing options...
Recommended Posts