Email Address:
Password:
Forgot Password?
Advanced Search
Active Players on Sylestia
Category Total Yesterday
Players 1,443 286
Sylestia Pet Data
Category Total Yesterday
Pets 8,858,409 1,170
Generated 714,629 163
Captured 1,257,463 171
Bred 6,886,179 836
Statistics updated daily at midnight
Forum Index > Q&A (Newbie Friendly) > Website Coding Question
Page 1  
Author Thread Post
Emgeal
Level 60
Seashell Collector
Joined: 4/13/2014
Threads: 10
Posts: 122
Posted: 6/11/2015 at 9:15 PM Post #1
I've decided I want to learn how to program websites and while the website I want to build is absolutely nothing like Sylvestia (and probably never going to be public) I want to figure out how to do the image building aspect of it.

What program do you guys use to code the site? Is it Python, Java, Ruby, PHP?

Specifically what program do you use to do the images. I'm going to be starting from the ground up with HTML, but I want to have the other language to play around with too.

I've seen a lot about PHP being used, but I've also heard that it's a bit of a coding mess and that Python is cleaner....
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,203
Posts: 15,167
Posted: 6/11/2015 at 11:13 PM Post #2
We use PHP for the server-side coding language for Sylestia. I've never used any other so I can't comment on which is better to use... but I do like PHP and find it easy to use.

As for the image builder, we use the built-in GD Library for PHP. You can read its entire manual here:

http://php.net/manual/en/book.image.php
Edited By Krinadon on 6/11/2015 at 11:13 PM.
Emgeal
Level 60
Seashell Collector
Joined: 4/13/2014
Threads: 10
Posts: 122
Posted: 6/12/2015 at 7:59 AM Post #3
Thank you so much. I'll go and read that and hopefully it will also give me new terms to search in Google that will actually get me better results on how-to's. (Apparently "combine multiple images in PHP" is not what I was looking for.)
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,203
Posts: 15,167
Posted: 6/12/2015 at 12:08 PM Post #4
In doing that, your code would look something like this (simple example):

First, you have to create a canvas when using GD Library. Assuming you want to create a PNG (transparent background), you'll need to do this:

//Create the Canvas
$image['image'] = imagecreatetruecolor(500, 500);
//Create Transparent Background
$image['transparent'] = imagecolorallocatealpha($image['image'], 255, 255, 255, 127);
//Fill Canvas with Transparent Background
imagefill($image['image'], 0, 0, $image['transparent']);


Now you can add your images:

//Load an image from a file URL
$layer = imagecreatefrompng($layers[$var_f][$i]);

//Copy the new Layer onto the Canvas
imagecopy($image['image'],$layer,0,0,0,0,500,500);


You can repeat this step as many times as is required. For our pets, this step can be repeated as much as 50+ times.

Once finished, you have to output the data:

//Set appropriate Header
header('Content-Type: image/png');
//Print Canvas
imagepng($image['image']);


One last important detail - the sizes of the Canvas and the images must match. So in the case of my example - they're all 500x500 pixels.
 
This Page loaded in 0.008 seconds.
Terms of Service | Privacy Policy | Contact Us | Credits | Job Opportunities
© Copyright 2011-2025 Sylestia Games LLC.
All names and logos associated with Sylestia are Trademarks of Sylestia Games LLC.
All other trademarks are the property of their respective owners.
For questions, comments, or concerns please email at Support@Sylestia.com.