Closed elreco closed 4 years ago
Hello, thank you for the interest!
Currently there is no easy easy way to do this, but there is easy way:
Source
// ...
$runes = $api->getStaticReforgedRunes()->runes;
$rune_paths = $api->getStaticReforgedRunePaths()->paths;
$match = $api->getMatch(...);
$player_stats = $match->participants[0]->stats;
// selected primary runes
DataDragonAPI::getReforgedRunePathIconO($rune_paths[$player_stats->perkPrimaryStyle]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk0]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk1]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk2]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk3]);
// selected secondary runes
DataDragonAPI::getReforgedRunePathIconO($rune_paths[$player_stats->perkSubStyle]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk4]);
DataDragonAPI::getReforgedRuneIconO($runes[$player_stats->perk5]);
Render
NOTE: To be able to use StaticData endpoints you have to initialize DataDragon API - more about that here.
Nice! Thank you so much.
Happy I could help! 😊 Feel free to ask in case you have any further questions :)
Hello :)
thank you for your wrapper!
I have an issue, how do you display the image path of the new runes ?
When I retrieve a match, I get 6 perks variables (perk0, 1, 2 [...]) but I don't know how to display the icons from DataDragon API.
Can you help me please ?
Thank you!