loadObject method
Future<void>
loadObject(
- String path,
- LoadedType type, {
- bool show = true,
- List<
Rect> ? locations, - ObjectType? objType,
- List<
String> ? names, - List<
double> ? scales,
Implementation
Future<void> loadObject(
String path,
LoadedType type,
{bool show = true,
List<Rect>? locations,
ObjectType? objType,
List<String>? names,
List<double>? scales
}) async{
await _loadImage(path).then((value) async{
int height = (allObjectImage == null?0:allObjectImage!.height);
loadedObjects.add(
LoadedObject(
size: Size(value.width.toDouble(),value.height.toDouble()),
objectType: objType??ObjectType.landscape,
type: type,
path: path,
show: show,
spriteLocations: locations,
spriteNames: locations == null?names:(names ??List<String>.filled(locations.length, 'Object Names')),
objectScale: scales,
offsetHeight: height
)
);
if(allObjectImage == null){
allObjectImage = value;
}
else{
await _combineImage(allObjectImage!,value).then((img){
allObjectImage = img;
});
}
update();
});
}