Monkuar Posted August 13, 2012 Share Posted August 13, 2012 right my code now is: $stars = imagecreatefrompng("./img/nrpg/base_m.png"); $gradient = imagecreatefrompng("./img/nrpg/swords/sword2.png"); // Copy imagecopy($stars, $gradient, -2, 21, 0, 0, 39, 39); // Output and free from memory header('Content-Type: image/png'); imagesavealpha($gradient,true); imagesavealpha($stars,true); imagepng($stars); imagedestroy($stars); imagedestroy($gradient); And it shows: MY male character with his sword in the correct position. But what If I want to add a hat/boots/gloves? How would I go about that? Pretty much I need a way to add more imagecopy items over the item Link to comment https://forums.phpfreaks.com/topic/267033-need-help-on-adding-more-imagecopy-paremeters/ Share on other sites More sharing options...
xyph Posted August 13, 2012 Share Posted August 13, 2012 Multiple calls to imagecopy? Link to comment https://forums.phpfreaks.com/topic/267033-need-help-on-adding-more-imagecopy-paremeters/#findComment-1369086 Share on other sites More sharing options...
Monkuar Posted August 13, 2012 Author Share Posted August 13, 2012 Multiple calls to imagecopy? WOW did not know you could that // Create image instances $character = imagecreatefrompng("./img/nrpg/base_m.png"); $sword = imagecreatefrompng("./img/nrpg/swords/sword2.png"); $boots = imagecreatefrompng("./img/nrpg/boots/boots1.png"); // Copy imagecopy($character, $sword, -2, 21, 0, 0, 39, 39); imagecopy($character, $boots, 29, 75, 0, 0, 38, 35); // Output and free from memory header('Content-Type: image/png'); imagesavealpha($character,true); imagesavealpha($sword,true); imagesavealpha($boots,true); imagepng($character); This is what I call server side securitY! Haha, now just check if the user has those items bought, and make the image server side. This is epic. OMG awesome, Thanks xyph!! Link to comment https://forums.phpfreaks.com/topic/267033-need-help-on-adding-more-imagecopy-paremeters/#findComment-1369088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.