PIM Team Case Study: Creating Text Effects With PHP and GDWritten by Bobby Handzhiev
PIM Team Case Study: Creating Text Effects With PHP and GD See how you can create graphic effects on text with PHP and GD - drop shadows, arcs, fonts and colors.Problem A-tec Signs and Sraphics Inc. launched a web site with idea to sell decals online. To achieve better customers ineterest website had to integrate online decal builder. The company is offering also decals for vehicles which brought some specific requirements to builder like having decal text turning arround 4 types of arcs. Goals - Provide users with preview area - Allow visitors to choose font and color - Allow adding drop shadow and selecting drop shadow color - Allow turning text into arcs - Real Time calculating Solution Because of need for increasing customers interest we had to think about not for perfect math formulas when showing graphs in preview area, but for people who will look at them. As we will reaveal below, there were few problems going arround human appreceptions for something 'perfectly smooth' and matchematical perfect figures. Methodology We were going to extensively use PHP GD library for text effects. It provided easy changing of fonts and colors, adding drop shawdows and rotating texts. We had also to create color palletes which to appear when user click and disappear when color is selected (You can personally try decals creating here). Using hidden layers and javascript was supposed to do work. The main problem in this site was to create 4 types of arcs so when user selects one of them text is created arround imaginary arc (like in vector graphical softwares). We were going to study Bezie's formulas and create these arcs with its help. Implementation PIM Team Bulgaria had task to build full functional online decals builder with following features: - Decal background Some users were supposed to have their decals placed on colored background. We had to allow preview area to be painted in a selected background. First we created image in temp folder: // name of destination image $dest='decals/'.time().'.jpg'; //the background imagefilledrectangle ( $im, 0, 0, 590, 60, $colors[$_POST['bcolors']]); $colors array contains available color which are stored by administrator in database. Thus, when visitor selects a background it is passed as parametter to imagefilledrectangle function. - Font selection Users should be able to select fonts for their future decals. Knowing that we can't consider all fonts will be available on all visitor's computers we had to upload them on web server directory. We allowed admin to manage fonts, adding their names and uploading files in admin area. The fonts in select box came from database. Selected font was passed in call to imagettftext funtion which is drawing on previously created image. - Color Selections The color selections had to be a palettes which appear when user clicks and disappear when color is selected. The palette had to look as a table with colors and these colors are also defined in admin area so they had to come dynamicly. We had to seed a static javascript function with dynamic content. We created a PHP cycle which was taking colors from database and then creating a string for HTML table. This table is then passed to a javascript function which creates palletes with help of hidden layers: function showTable(table) { mouseX = window.event.x + document.body.scrollLeft+25; if(table=='background') { var content="=$table?>"; var y=460; } if(table=='fonts') { var content="=$ftable?>"; var y=690; }
| | : Counter Strike, The beginner of Broad Band Pc Gaming:Written by Fahad Ahmed Bashir
: Counter Strike, The beginner of Broad Band Pc Gaming:This is world of 21st century, century of technologies. Every thing is fast now a days and as far as Computers and games are concerned, they are at top of all. Every one these days like playing games and some of them love it. Well few years ago PC gaming was not so advance and usually was single user based and if any one wanted to play with any other player then one must have an extra input or any compatible playing device . An era of new technology began after entrance of Network gaming or Multiplayer gaming which revolutionized PC gaming world. The term of multiplayer gaming was that from now on if a person wants to play a certain game with any other person he can easily connect to other person’s computer using broad band internet connection . Usually before arrival of Broad Band, games were played thorough Modem. This was perfect in those days as games were not too heavy and only few packets of data are sent and received. However over years this scene has changed greatly. SWITCHING TO BROADBAND: Now a days multiplayer games send and receive more data and therefore need faster protocol for sending and receiving data items. Amongst those of course is COUNTER STRIKE. Few years ago when there was no concept of Broad Band, one would really be able to get anything faster than ISDN connection. But today as compared to past we have much greater availability and much greater broad band technology like DSL and Cable Modem as compare to normal dialup modem. So PC gaming has become very much advance and high quality games can be played at a very high speeds. Counter Strike is most popular multiplayer game using Broad Band Connection. THE GAME : Without any doubt it is most popular game played over years and is modification of half life developed by Valve. It is FPS (First Person Shooter) type game and is totally action packed. The game is divided into two teams The Terrorist Forces and The Counter Terrorist Forces. The game is played on some Maps which have different locations and objectives. According to these Maps Counter Terrorists and Terrorist Forces assassinate/ Escapes, Hostages/ Rescues and diffuse bomb etc..
|