User Tools

Site Tools


wargroundscanberra:character_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wargroundscanberra:character_sheet [2024/08/19 20:34] curufeawargroundscanberra:character_sheet [2024/08/30 15:32] (current) curufea
Line 1: Line 1:
 ====== Character Sheets ====== ====== Character Sheets ======
 ^  Go back to [[start|Wargrounds Canberra]]  ^ ^  Go back to [[start|Wargrounds Canberra]]  ^
 +
 +
 +===== No Longer Used =====
 +This project has been superseded by NanDeck (makes it much easier). But I'll keep it on my website just because it was fun to do.
 +
 +==== Forms ====
  
   * Working Form: [[form|Fill in Character Sheet]]   * Working Form: [[form|Fill in Character Sheet]]
   * Working Location: [[https://www.curufea.com/image.php]]    * Working Location: [[https://www.curufea.com/image.php]] 
-  * Test (Fletching, Character Backgrounds)+  * Test (same as working)
     * Form: [[form test|Fill in Character Sheet]]     * Form: [[form test|Fill in Character Sheet]]
     * Location: [[https://www.curufea.com/image_test.php]]     * Location: [[https://www.curufea.com/image_test.php]]
 +
 +==== Code ====
  
 <code php> <code php>
Line 239: Line 247:
 $im4 = imagecreatefromjpeg($photo); $im4 = imagecreatefromjpeg($photo);
 $ratio = imagesy($im4)/imagesx($im4); // Try to keep the photo in the same aspect ratio $ratio = imagesy($im4)/imagesx($im4); // Try to keep the photo in the same aspect ratio
 +
 +$start_x=round($width/1.8);
 +$start_y= round($width/1.5);
 +
 +$i_width= round($width*0.4);
 +$i_height= round($i_width*$ratio);
 +
 +$end_x= $start_x+$i_width;
 +$end_y= $start_y+$i_height;
 +
 +
 // Draw border // Draw border
-imagefilledrectangle($image, round($width/1.8), round($width/1.5)round($width*31/32)round($width*6/16/$ratio+$width), $fontcolour);+imagefilledrectangle($image,$start_x-$borderwidth,$start_y-$borderwidth,$end_x+$borderwidth,$end_y+$borderwidth, $fontcolour);
  
 // Resize and place in character Sheet // Resize and place in character Sheet
-imagecopyresized($image, $im4, round($width/1.8)+$borderwidthround($width/1.5)+$borderwidth, 0,0, round($width*31/32)-round($width/1.8)-$borderwidth-$borderwidthround($width*6/16/$ratio+$width)-round($width/1.5)-$borderwidth-$borderwidth, imagesx($im4), imagesy($im4));+imagecopyresized($image, $im4, $start_x, $start_y, 0,0, $i_width, $i_height, imagesx($im4), imagesy($im4));
 imagedestroy($im4); imagedestroy($im4);
- 
  
 // tell the browser that the content is an image // tell the browser that the content is an image
Line 257: Line 275:
 </code> </code>
  
-===== To do ===== 
- 
-  * Possibly API use for wherever photos get stored (or just upload them) - may need to edit photos to fit 
  
  
wargroundscanberra/character_sheet.1724124855.txt.gz · Last modified: 2024/08/19 20:34 by curufea