Texture.fromJson constructor
Texture.fromJson(
- Map<String, dynamic> json,
- dynamic image
)
Implementation
Texture.fromJson(Map<String, dynamic> json, image) {
_init(
image,
json["mapping"],
json["wrap"] != null ? json["wrap"][0] : null,
json["wrap"] != null ? json["wrap"][1] : null,
json["magFilter"],
json["minFilter"],
json["format"],
json["type"],
json["anisotropy"],
json["colorSpace"]
);
name = json["name"] ?? "";
if (json["offset"] != null) {
offset.copyFromUnknown(json["offset"]);
}
if (json["repeat"] != null) {
repeat.copyFromUnknown(json["repeat"]);
}
if (json["center"] != null) {
center.copyFromUnknown(json["center"]);
}
rotation = json["rotation"] ?? 0;
flipY = json["flipY"] ?? true;
premultiplyAlpha = json["premultiplyAlpha"] ?? false;
unpackAlignment = json["unpackAlignment"] ?? 4;
userData = json["userData"] ?? {};
}