The way styles work with MeshBatch
is the style used is the style of the first Mesh added to the MeshBatch. See MeshBatch.addMeshAt
and how it calls MeshBatch.setupFor
only if the MeshBatch has no vertices, so if it is the first Mesh being added. So make sure you set the style and other settings on that Mesh.
So once you’ve set it up it should just work. Normally Starling picks the default MeshStyle
when you create a Mesh
, or create any of its subclasses like Quad
, Image
. Once its done that it leaves it in place, so if you replace the default with your own it uses that instead.
It must be something in your code, that is either removing it or not adding it when it should. MeshStyle should be a set-one-and-forget thing, so you may be overcomplicating it if you have code trying to set it in multiple places.