Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

2009-03-08

Custom Floor Images, Part 2

Alright, if you followed Part 1 of this tutorial you learned how to easily slice an image up into pieces so you can use it as a custom floor tile. Now I'm going to show you an easy way to load those tiles into your world and lay them out in the right order.


I'm going to open up my world first. You can see the world I'm using for this tutorial here -Tile placement. Across the top of the screen look for the yellow "shape your world" button. Click on it and then click on the "paint the ground" button.


A side panel will open on the right hand side of the screen showing the tiles that are already loaded for your world. Look for the + sign at the top of this side panel. (I've circled it in red for you.)


Clicking on the + sign opens up a new sub-menu. Click on the triangle between the Y! and the words "What are you looking for?" You now see some more choices, including the one we're looking for "upload." Clicking on Upload calls up a new window. Within this window you can browse to the folder where you've saved your images. Select all of your images (use the Shift key to select a range of images at one time.) and then click OK.




All of the tiles you selected will be displayed in a new window. At the bottom of that window click on the button that says "create selected tiles."



The system will now display each of those graphics as an image, a tile and an inworld preview. Just click on the "next" button and work your way through all of them. After you get to the last one the creation window closes and you are back in your world. Look in the "paint the ground" sidebar and you'll see all of your new tiles there.

It used to be that you would have to laboriously work your way through all of the tiles placing them one by one. Then Obo wrote a very useful plugin called Batch Map Paint. How do you get it? Along your top menu bar go to add objects > from marketplace. Then do a search for Batch Map Paint and buy that puppy!


Now before we go any further you are going to need to know the coordinates of the tile where you want the image to be placed. In build mode click on the select object tool. Underneath it you will see a set of x & y coordinates that change as you move the cursor around the screen. (The picture makes this a bit more obvious.) Just round off the numbers. In this case that would be X=4 Y=5

Go ahead and open the console. To bring the console up, press the backtick (`) key in the upper left corner of most keyboards. To close the console, press enter while the console is active. On a UK keyboard layout ( ' ) opens the command line. Batch Map Paint requires you to enter the following

batch_map_paint prefix x y width height

Prefix is the base name that we used in back in Fireworks. In my case it was mucha

x and y are the map coordinates to begin painting we figured out this would be 4 5

width and height are the size of the area to paint. mucha was a 5x5 tile image

So in my case I would need to type:
batch_map_paint mucha 4 5 5 5

Hit the enter key and the magic happens! Now this may seem a bit complicated the first time or two you do it, but trust me it makes life a whole lot easier once you have got it down. Thanks again for creating the plugin Obo!

2009-03-06

Custom Floor Images, Part 1

FYI I'm using Fireworks 3 for this. We're using Fireworks because it will let us slice an image along a grid and we can save the resulting output as sequentially numbered PNG files.

Fire up the program and go to File > New to create a new graphic. Set the size to 320x320 pixels and the resolution to 72dpi. It's important to set the size to a multiple of 64. Why? Because the tiles in Metaplace are 64x64. We'll be making an image that covers a grid 5 tiles tall by 5 tiles wide so we need our graphic to be 320 pixels square. (5x64=320) Set your canvas color to transparent and click the okay button.



First off we want to set up our grid. Press Ctrl+Alt+G This will call up our Edit Grid window. We're setting a few things in here. (I cheated because although the screencap shows yellow as my color I changed it to red later. Doh!) From the top we have the color of the grid. Just set this to something bright that will stand out. Next make sure the check boxes are filled in next to "Show Grid" and "Snap to Grid." Finally set the size of the grid to 64x64 pixels. Now click on OK.


Now we need the Slice Tool. It is at the bottom right hand side of the Toolbox. I added a red outline in this picture to help point it out. Click on the Slice Tool to select it. Now go to the top left hand corner of your image. Click and hold the mouse button down and drag your cursor until it snaps to the first set of guides. (You'll end up with something like this.)

Continue working your way around the graphic until you have a slice for each of the 25 squares in your grid.

Now we're going to save the file. Why? Because it's a pain in the butt to draw all 25 slices and you shouldn't have to do it more than once. Hit Ctrl+Shift+S. Give it a nice simple descriptive name like 5x5floor. Now we have a handy 5x5 grid that we can use over and over.


Next step Ctrl+R or File > Import. We're going to bring in a picture and get it ready for slicing. After you take that first step you'll notice a little corner indicator tool. Just click within your graphic and the image is imported. You can see in my screencap that the image is larger than our 5x5 graphic. Let's fix that. But first let's make things a bit easier to see. We're going to turn off the visibility of those slices.


If your Layers palette is not already visible press Ctrl+Alt+L. Right now there should only be two layers: Layer 1 and Web Layer. Click on the eye graphic next to the words Web Layer. All the green stuff goes away! The slices are still there, they're just invisible for the moment. You can also still see the gridlines for a reference point if you need it.

Click on your imported image. (I'm using some great art by Alfons Mucha, btw.) Hit Ctrl+T. This puts you in transform mode. Just grab the corners of the rectangular guide and resize your imported image until it fits within the 5x5 grid. Be sure to hold down the Shift key while you're resizing so you don't stretch or squash the image. Hit Enter when you're done resizing.


It's time to export our graphics. Go to File > Export Preview (Ctrl+Shift+X) Export Preview gives you more choices in the output of the final image and choice is good. Under the option tab set the file format to PNG24 (You can also output PNG32 files - which = alpha channels = equals floor tiles with transparencies!) Click on the Export button.

The next screen let's you pick the base name you want to use with the files and where you want it saved. I used mucha for my base name to help me remember what the tiles are about. Make sure that under Slicing it says Use slice objects. For HTML you can set the style to None since we just want the images. Click on Save. Whoo hoo, we're done! Fireworks has sliced up our graphic into 25 even pieces and even went ahead and named all of the files for us. If you check the destination folder you saved the files to you'll see a bunch of graphic with names like mucha_r1_c2.png. The software took the base name and added the row and column position of the tile. Why should we care? Because Obo created a swell plugin that will read that info and automatically lay our tiles out in the proper order. Next time I'll show you how to use that.

2009-02-27

The Stained Glass Effect, Part 2

If you've been following along you hopefully have a nice, glowy, colored patch of light on the floor. To give it that extra little touch we're going to add some rays of light streaming down from the ceiling.

First thing I did was get a screen-grab of the room with the patch of light on the floor. I just find screen-grabs really helpful in making sure I've got objects sized right before I upload them to Metaplace.
I opened the image in Photoshop and created a new empty layer. On this layer I drew a number of colored blobs that matched the sections of floor beneath them. (The picture probably makes more sense than the written explanation for this little part.

Go to Edit > Transform > Scale and stretch the blocks out until they are vertical stripes of color going from the top to the bottom of your screen.

Go to Filter > Noise > Add Noise I used around 20%, Uniform Dsitribution and the monochromatic settings. Now Filter > Blur > Motion Blur with an angle of 90 degrees and a distance of 20 or so.
Now we're going to change the shape of the rays a little bit. Use Edit > Transform > Distort. Grab your corner control boxes and narrow the top of the box while stretching out the bottom. (Again, the picture should make more sense.) Lower the opacity of the stripes layer to about 30-40%.

Now we're going to soften the rays up a little. Hit the D key to set your foreground and background colors to black & white. Click on the Add layer mask button.

Now go to Filter > Render > Clouds. Let's tighten the contrast a bit. Use Ctrl+L to adjust your levels. Bring the right and left hand sliders in towards the center. Since the cloud function is random, just eyeball the effect you're getting until you see something you like. Switch to your brush tool, make sure you have a soft edge and paint some black over the lower edges of the graphic to match the curve of the circle of light (Once more: picture > convoluted verbage.)

Turn off the visibility for your background layer. (The one that held the screen grab of the floor.)All you will be seeing if the colored stripes over a transparent bkg. Go to File > Save as wenter a name for the file and change the file type to PNG. This is important because the PNG file format will save all that lovely alpha channel info we just created. The graphic is all done. Let's bring it into your world!
Load your world in the web browser. Go to Advanced > Sprites. Click on the + sign to add a new sprite. Next to the phrase "What are you looking for?" click on the triangle to open the sub-menu, then click on upload. A new window will open, allowing you to browse to wherever you just stored that ray file on your computer. Select the file and click on open. On the next screen click on create selected sprites. Close your sprite window.
Go to the get more stuff menu. then click on new object. Click on the pick from your world button. Find your new stripey rays sprite. Double click it. Click on the create button and you new object is done. Tweak the size up or down as need to get the circle of rays the same size as the circle of light you already built into the floor. Sit back and enjoy your work!

2009-02-24

The Stained Glass Effect, Part 1


I wanted to create the look of light pouring through a stained glass window and casting a design on the floor. Here is the end result, that incorporates a couple of different tricks I used. Let's go through the steps and I'll explain how you can create the same thing. I used Photoshop CS2 for most of the work with a nice assist by ImageReady.
First of all we need a tileable floor pattern. I did some image Googling and found the above image. I then resized the image to be 64 pixels square. (The Metaplace default zoom has each tile being 64x64 pixels so I like to create my graphics at the same size.) Now use the Ctrl+A keystroke combo to select the entire floor graphic. Go to your menu bar and select Edit > Define Pattern Enter a name for the new pattern and click on the OK button. You've just created a new custom pattern that matches your floor tile.
Now we'll create a new document. We want this one to be 256x256 pixels. Why? Because that way the graphic will be 4 tiles across by 4 tiles high. Select All again (Ctrl+A, remember?)and go to Edit > Fill. The new window that pops up will have a sections labeled Contents. Use the drop down menu bar to select Pattern. Then click on the triangle next to the words Custom Pattern. This will pop up the choices of custom patterns on your system, one of which will be the floor pattern we just created. Click OK and your graphic gets filled with the tileable floor pattern.

Now we need the stained glass image. You can search up something that you like. I decided to use the above image. Now there are a few things we need to do with this new graphic. First, paste it as a new layer into the floor graphic. Second, add a little blur to the image. This makes everything look a bit more realistic. The amount of blur is up to you and really depends on the type of floor you're trying to depict. I'm creating a rough, stone floor so I blurred the image more than I would have if it was a shiny, smooth linoleum floor. Third, rotate the graphic 45 degrees counter-clockwise. We're doing that because when we create the tiles in Metaplace the software is going to rotate the images 45 degrees clockwise, so we're compensating for that now. Last of all, lower the opacity of the layer down to around 37% and change it's blending mode to Hard Light.

Our next step is going to be cutting the graphic up into a number of equal sized pieces. Add some guides both horizontally and vertically at the 64, 128 & 192 pixels mark. Go to File > Edit in ImageReady. This will start up ImageReady and open the file for you in that program. On your menu bar select Slices > Create slices from guides. Your graphic is now divided into 16 numbered boxes. Go to File > Save Optimized As. Enter a file name and change the type to "Images only". Click on okay. The nice part of using ImageReady for this is it does the laborious work of slicing, saving and sequentially numbering the images for you. The downside is that it only creates gif files.
We're ready to fire up the web browser and dial in to Metaplace! Go to your world and click on the build button. Click on the build your world button then click on the paint your map drop down button. At the top of the paint your map side panel there is a little row of icons. Click on the + sign to add some new tiles. The popup window that opens has a little triangle next to the phrase "What are you looking for?" Click on the triangle, then click on the word Upload. This opens yet another window where you can navigate to the folder where you saved all of the tiles in the previous step. Select all of the tiles. (You can use the shift key to select a range of tiles.)

At the bottom of the window is a Create selected tiles button - click on it. You then can click on the next button to create all of the tiles.
When you finish that you're back in paint the map mode. Now you can just paint out the individual tiles in a 4x4 grid and there's your stained glass! Just like an incredibly easy jigsaw puzzle.

Next time we'll look at how to add some rays of light shining through the air.