newRegionAttachment method

  1. @override
RegionAttachment newRegionAttachment(
  1. Skin skin,
  2. String name,
  3. String path
)
override

Implementation

@override
RegionAttachment newRegionAttachment(Skin skin, String name, String path) {
  final TextureAtlasRegion? region = atlas.findRegion(path);
  if (region == null) {
    throw StateError(
        'Region not found in atlas: $path (region attachment: $name)');
  }
  region.renderObject = region;
  final RegionAttachment attachment = RegionAttachment(name)
    ..setRegion(region);
  return attachment;
}