Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, November 27, 2011

Changing Icons in Visual C++ Express Edition

I recently started working on a game in C++, using (as a starting point) a game engine that I helped create in a Game Engine Architecture class I took at DeVry University this past year. I'll be revising the engine and tailoring it to my needs for the game, as well as abstracting the engine portion from the game portion (so it could potentially be reused, and also to get some experience with that kind of coding).

I decided that whenever I solved some troublesome problem or had something interesting to say about it, I'll blog it here. It didn't take long for me to find something.


Application Icons

Anyone who uses a computer knows what an icon is, right? It's used for a shortcut on your desktop, or the Title Bar for a window, or in the application window in the Taskbar. When programming in Windows, you can obviously customize that by using an .ico file, which is essentially a small bitmap image.



So... it seems like this should be something that's easy to change, yes? I thought so too, and ended up spending a few hours trying to figuring it out.

And before you say it, no, I'm not stupid. The problem stems from two things: 1) my relative green-ness at C++ coding (not an expert yet) and 2) the lack of features in the Express Editions of Microsoft's Visual C++ IDE. The Express Editions are free, which is great; however, they aren't as full featured as retail versions of Visual Studio, and that sometimes makes a task that should be very easy to do, a bit difficult.

Such is the case with the Express Edition. You can't programmatically add resources through the application and there's no resource editor. You can do it manually, though (anything can be done manually). Just a heads up, I currently use the 2008 edition and this tutorial will be written from that perspective.

Searching the Internet

Whenever I hit a roadblock in coding, the first thing I generally do is search the internet. Nine times out of ten, someone else has already asked the same question and gotten an answer. All you have to do is find it. So I start searching with Google.

The first thing that confused me about this problem, was that no one had a simple explanation of the entire process. It was in bits and pieces and I had to put it together (which prompted me to write this post). The second was that some people were talking about one or the other, i.e. the problem of the icon for the final .exe (desktop shortcut) you create vs. the icon used in the window title bar or taskbar. At first I didn't understand this distinction – I was focusing only on the window title bar icon, not the .exe one.

It took me a while to get this sorted out, so hopefully this complete explanation will help someone.

The Resource Header

The first thing you need when dealing with resources, is a header file that defines the resource variables you want to use in your project. We'll only need variables for small / large versions of your icon. Use Visual C++ to create a header file: right-click Header Files in the Solution Explorer, go to Add à New Item. In the templates, select Header File (.h), enter the name at the bottom (I called mine Resource.h) and click Add. There should be an empty .h file in your project now.

Open that header file and add this code:



    #define IDI_ICON_BIG 1
    #define IDI_ICON_SMALL 2



This defines two variables that we can use in our code. The compiler will treat them as integers (1 and 2), but a string version makes it easier for us to read in code. You can change those variables to whatever you want, but use the prefix of IDI_ since that's the standard format for icon resources and it's good practice to use that.

Before you save and close the file, add a few blank lines at the end. If you don't, you might get an error like this when you compile the header file later:

fatal error RC1004: unexpected end of file found

This is a bug in the compiler and is fixed by adding the extra lines at the end. I found the solution at a site called Code Library.

With your extra lines added, save and close the file.

The Resource File

Next, you can create the resource file itself. This file essentially associates resources (like an icon) to the variable that you use in code. In the IDE, a resource file is usually represented with a suffix of .rc. Aside from the resources themselves, all other files in a project/solution are generally text files. So the easiest way to create a resource file is to create a text file and save it in your project folder – the same folder as your winmain.cpp file – and use the .rc suffix instead of .txt when you save it. I named my file app.rc, but you can name it something else if you wish.

You can then edit the file in a generic editor like Notepad, or you can add it to your Solution in Visual C++ manually and edit there. To add it, right-click on Resource Files in the Solution Explorer and go to Add à Existing Item. Navigate to your .rc file, select it and click Add.

Now edit the file. You can have a different icon for each thing (executable, window title bar and taskbar), so we'll set it up that way even though you might want to use the same icon for all three. If you try to double-click the .rc file to edit it, you most likely will get this warning:

Curse you, Express Edition!!

To get around this, right-click the .rc file, select Open With on the menu, then in the dialog that appears, select "Source Code (Text) Editor." You'll now be able to edit it in the Code Window. Add this code:



    #include "Resource.h"
 
    IDI_MAIN_ICON ICON "res/app.ico"
    IDI_ICON_BIG ICON "res/XXXX.ico"
    IDI_ICON_SMALL ICON "res/YYYY.ico"



Where app.ico is the name of the icon file you want for the executable, and XXXX.ico and YYYY.ico are the names of your big and small icons for the windows, respectively. Replace those with your own names, but Windows will use app.ico as the default filename for the executable icon, so you'll need to use that for that specific icon file.

This associates your resource variables with the files themselves. You need to include Resource.h so the compiler knows their definitions. The ICON term denotes that it's an icon resource, and the path in quotes is the path to the file in your project.

Now, you could just put the .ico files in your main project folder, but if you have a lot of resources, it's better to keep them separated and organized. I put mine in a folder called res in the main project folder. You can put them wherever – just make sure the path is updated accordingly.

You can read more about Resource Files here.

Icon Files
If you don't already have your .ico files, go get them now and come back. If you're looking for some to test or whatnot, you can find free ones on the internet. I like this site, personally: Icon Archive.

If you have picture files that you want to convert to an icon, there are numerous websites that will do this for you. Here are a few to start with:
  
Once you have them, name them appropriately (app.ico for the executable, of course). Make sure the names match up to your .rc file and you have saved the files in the right location within your project folder tree. Add them to the Solution Explorer in the same manner as the .rc file previously (add existing item). You don't technically have to add them to the Explorer, as the compiler will know where to get them from the .rc file, but it's good practice and helps you keep tabs on your files.

Load the Icons

Everything is now in place to add your icons to the window / taskbar. In your code (winmain.cpp), you should have something that initializes the window class that you're using. Here are the pertinent lines of mine (the full code is linked further below):



    bool initWindow(HINSTANCE hInstance) {
 
    // initialize the window class
    WNDCLASSEX wcex;

    wcex.hIcon = LoadIcon(hInstance,
                     MAKEINTRESOURCE(IDI_ICON_BIG));
    wcex.hIconSm = LoadIcon(hInstance,
                     MAKEINTRESOURCE(IDI_ICON_SMALL));
    // other wcex properties excised...

    RegisterClassEx(&wcex);

    // code excised...

    return true; 
    }



For the hIcon and hIconSm properties, you merely load the icon with LoadIcon, using the variables we set up in the resource header and resource file. Rebuild your project and voila, the window, taskbar and executable should have the correct icons!

Compiler Notes

If you're experimenting a lot and your project doesn't take too long to build, a good thing to do is to clean your solution before rebuilding it. What this does is delete the compile-time files that are generated, like the executable, or a .res file.

Speaking of .res files, this is a compiled file that consists of all resource objects (icons, bitmaps, etc) and associated .rc files. Visual C++ will compile this for you from the files in your project, and it should appear in the Debug folder under the main project folder after rebuilding.

You can compile these files yourself by using the Resource Compiler (rc.exe) that comes with the Windows SDK. Search for it on your computer, place any .rc and associated resource files in the same folder, then use rc.exe via the command line. Here's a good article on how to use it. And the full documentation on MSDN.

My Project

The game I'm working on is called You Are Cat. The code I'm working with is visible as an open source project (Eclipse Public License 1.0) on Google Code. You can view it here.

I've decided to make it available since it will hardly be the final version of the game (if I ever finish) and because I'm taking parts of the code from the basic engine created at DeVry with some other students.

As far as the game, I'm not going to explain what it is about or what you actually do. You'll have to figure it out from the code, if you're so inclined.  

Wednesday, November 9, 2011

How to Easily Format an eBook [3] Convert / Verification

This is the 3rd post in my tutorial about formatting an eBook for Kindle or Nook. You can read the first post about overall text formatting here. You can read the second post about title pages and a table of contents here. This post deals with the final step, converting your text into the requisite eBook file for Amazon or B&N and verifying it.

Once all the formatting and features are finished, you are ready to convert your file into an eBook file. For Kindle you can use .mobi and for Nook you can use .epub. You can create both from the same initial Word file, so the entire process is very easy.

Save as Filtered HTML

The first step is to save your Word document as Filtered HTML. An eBook file is really nothing more than an HTML file, so by saving as one initially you've have done half of the work already. Saving as Filtered HTML preserves all the formatting of the Word document, but removes much of the tags that Word/Office use for their specific functionality, cutting down on file size and tags that have no place in an HTML file.

To do this, merely do a "Save As" in Word (F12) and in the Save as type dropdown at the bottom, select "Web Page, Filtered."


Below that dropdown, to the right, you'll see a tag called "Title" (which might say Add a Title next to it, or already have a title from your file in it). Make sure this is set to the title of your book.  Select and change it if necessary.

When saving, save it two times – one with a filename that denotes it for Kindle, and one for Nook. That way you can convert each one separately in Calibre without any issues. If you want, update the type of edition in the Copyright Page for each to denote that one is the Kindle Edition and one is the Nook Edition.

Once saved, you can move on to conversion.

Calibre

The software I've used to convert my books is Calibre. You can find out all about it on the Calibre website, calibre-ebook.com. It can be used as an eBook manager if you so desire, but I only use it to convert files. It's very easy to do, and it has the added bonus of being free. The conversion discussed in this tutorial will only use Calibre.

First of all, download and install Calibre. Once done and the program is opened on your computer, you'll notice that there are a lot of options and it may be a bit overwhelming. No worries, there are only a few steps you need to take.

Add/Update Your Book

The first step is to merely add your book to the list in Calibre. Click the "Add Books" button at the upper-left and navigate to and select the HTML file for your book. If you have more than one HTML file (if you saved one for Kindle vs. Nook), then add each separately. Anything added will appear on the eBook list in the middle of the main window, like so:


From there, you'll need to update your book settings so that everything is set for when you convert the file. Highlight the book in the list and select the "Edit Metadata" button on the toolbar at the top, or right-click and do the same thing. Either way, the Edit Metadata dialog will appear:


Make sure to update the Author(s) and Author sort textboxes appropriately. The Title and Title sort should be set, but update them if they are not. I believe the sort is only used in the Calibre list, but it doesn't hurt to be accurate with them.

This is also where you are going to attach the cover for the book. For publishing on Amazon or B&N, I suggest having two sizes of your cover: 600x800 and 180x240. The first will be used in the eBook itself, while the other can be used for uploading to the Amazon and B&N websites. In Calibre, select "Browse" in the Change cover section and navigate to your 600x800 version.

Also, remember to update the Date and Published fields to denote when you actually created/published the eBook file. Click "OK" when you are ready to save the updates.

That's really all you need to update on the file. Now you are ready to convert.

File Conversion

Merely select your book in the list and click "Convert" on the toolbar. It will bring up a Convert dialog, and if you already did all the updates mentioned in the previous section, there's only one thing you'll need to change. In the upper-right corner, there is a dropdown for Output format. Change this to the desired format – MOBI for Kindle, EPUB for Nook.


Once your desired format is selected, click "OK" to convert. It will take a handful of seconds to process. Once done, you can find your final file in the book's folder wherever you designated the Calibre Library to be on your file system (during installation of the program). That is the file you will use when submitting to either Amazon or B&N.


Verification / Quality Assurance

Before you submit, however, you should always check the file in the target eReader to make sure it appears as you want it to. Generally, if it looks good on Kindle, the Nook version will look just as good.

I do most of my checking on Kindle, since I actually own one. You can easily copy your file to your Kindle by merely plugging the USB cord that comes with your Kindle into your computer. Copy the .mobi file and paste it into the high-level Kindle directory where all the other books on your Kindle are. Disconnect the Kindle, turn it on and check out your book.

For help on transferring files to your Kindle, check here.

If you don't have a Kindle handy, you can easily check using the Kindle Previewer program, which can be downloaded here. It's a simple program that will open any compatible file so you can see how it would appear on a Kindle.  Be aware that this is not the Kindle reader app for PC - you cannot add a custom book to that app.  If you want to look at it on your PC or Mac, you'll need to download the Previewer application.

Change the font style or size. Test out the Table of Contents and the links there. Make sure all your special pages (Title Page, Section/Part Breaks, etc) look sufficient. Nothing will look that good in super-large fonts, so don't worry about those; just test the smaller fonts that most people will use.

Another important thing to check is whether the paragraph indents are working properly (based on the steps taken in the first post of this tutorial). Unfortunately, the only way to really know if all the formatting is okay is to actually read through the entire book on your eReader, making note of each instance that needs to be fixed (I do a final reading in this fashion, using the Note feature of the Kindle to mark areas for adjustment).

To test on Nook, I merely used the Nook app on PC and my Android handset. You can find all the versions here. Nook functions pretty much the same way – if it looks good on Kindle and the Table of Contents work, chances are it will work on Nook as well. But it's a good idea to try it out on at least one version of the Nook app (or the Nook itself, if you have one).

Next Steps

All that's left is to get them published on Amazon or B&N. I'll leave how you do that up to you... but hopefully someone has found these tutorials helpful in some way. Post a comment if you have any questions.

Shameless promotion: If you want to see how this all looks in final eBook form, download a free sample of my book in Kindle or Nook formats. You could also try reading it as well. ;)

Thursday, October 27, 2011

How to Easily Format an eBook [2] Title Pages / Table of Contents

This is the 2nd post in my tutorial about formatting an eBook for Kindle or Nook. You can read the first post about overall text formatting here. This post deals with Title Pages and the Table of Contents.

Once you have the basic text ready to go (according to the first part of this tutorial), you'll need to add any extra pages like a Title Page, a Copyright Page, Part/Section Pages, etc. Essentially anything that you want in your eBook that is not part of the normal text. For my eBooks, I created all of the above, including a Table of Contents.


Title Page

The title page in your eBook is essentially the first page after the cover. Usually it just says the book title, the author's name and any other info (like a tagline, publisher, etc) that you deem absolutely necessary. But for the most part, it should just be the title and author.

For my novel Bonebearer, all I did was this:


Very simple. On the Word page, start the title around 7-8 lines down from the top. Put a few spaces on each line to ensure that they remain after you convert it to the eBook format. Try to keep it tight overall and only in the first half of the page so it looks good with the most common font sizes a reader may choose for their eReader. Feel free to use larger size fonts (as compared to your normal text). When converted to an eBook the size differences between the two will remain.

Also remember to keep it on its own separate page, with page breaks between it and nearby pages. Page breaks force a new page in eReaders, so don't forget to use them when needed.

Copyright Page

There are a lot of different ways you can do this. One is to just pick up some of the books you own, look at their copyright pages and imitate them in some form or fashion (that is what I did). Add credits for any additional contributors. Go ahead and put a disclaimer about it being a "work of fiction" and that it's copyrighted, etc etc. Put it on a separate page entirely, with page breaks, like you did with the title page.

Technically you already own the copyright from the moment you create it, further reinforced by fixing your work in some tangible medium (an eBook); you don't have to file for copyright with the U.S. Copyright Office unless you want to bring a lawsuit against someone for infringement. So that's up to you.

For more info on copyright, please check copyright.gov. It's a good idea to read through the FAQs so you're familiar with the basics before publishing anything.

Yet... why bother with a copyright page? Well, because it looks professional, that's why. Plus, they are not hard to make. The extra effort will make it look like you care (which you do, right?).

Here is the copyright page from my novel, Bonebearer:


You will notice I added things like "Cover art by" and an author website. I also have an ISBN, which is something you may or may not have. It is not required in order to sell an eBook, but if you're really trying to be serious about selling your writing, it's a good idea to have one so your work can be identified for a few reasons (as taken from here):

· for the purposes of trading through conventional channels
· for search and discovery in publicly available retailer databases
· for item/product-level sales reporting (whether for royalties or for sales data reporting)

Whether you want to get an ISBN or not is up to you. They even suggest having a different one for each eBook format, but I have used the same one for both my Kindle (.mobi) and Nook (.epub) formats of Bonebearer. Read more about ISBNs on isbn.org.

Part / Section Pages

If your text is broken into discreet parts – i.e. Part 1, Part 2, etc – then you should make them on separate pages (with page breaks) as usual. Format it however you wish, but follow the same basic techniques mentioned for the title page: start it a few lines down the page (with spaces on the blank lines to force them to appear in the eReader format), use different sizes/styles of font as needed, and try to keep it in the first half of the page.

I would suggest using a large size font so that the reader knows it's a part / section break. Here's an example of a part break from my novel, Bonebearer:


I have a quote for each part in that novel. You might just have Part 1: Part Name or whatever. As usual, keep it simple and elegant. No need for crazy pictures or too much variation in fonts.

Don't forget that each part / section page needs to be on a separate page with page breaks separating them from the text. It's important!

Table of Contents

Here is one of the most critical parts of your eBook. A properly done Table of Contents will enable the reader to jump around in the book easily and it also meets the standards that Amazon or B&N recommend for their eBook formats. With one in place, it will also display page numbers in the Kindle format.

To create your Table of Contents, you must add a bookmark in each spot that you want to put on the list. So if you have chapters, add a bookmark at the beginning of each chapter. This can be a tedious manual process if your file is quite large and you have a lot of chapters, but you'll only have to do it once and it will be worth it. Why? Because it will look professional and it shows you care about your final product.

To add a bookmark in Word, first place the cursor where you want it, then select Insert -> Bookmark on the toolbar / ribbon:


This will bring up the Bookmark dialog. Type the name of your bookmark in Bookmark name (overwrite whatever is in there, it may show an existing one). I usually do something simple like "C01" (Chapter 1) or "P01" (Part 1) so I can easily identify it later. Click "Add" to add the bookmark. Go through your entire file and add each new bookmark one at a time.

Once that is done, add a new page near the beginning of your file, typically after the copyright page and before the text begins. This will be your Table of Contents page. Format it however you wish and type out the chapter names. Don't bother with page numbers or the full justification that you might see in a physical book. Just simply list everything.

When your list is complete, highlight a chapter name. Right-click and select "Hyperlink." In the Insert Hyperlink dialog, you'll have the option to add a few different types of links. You want to select Place in this Document, then select the name of the bookmark you made for that chapter. Like so:


Click "OK" and the link will be added. Your highlighted text now looks like a link you might see on a web page, but instead it will jump to the bookmark (and thus the chapter) in your text. Repeat this for every chapter name in the Table of Contents.

Yes, it is tedious. But you only have to do it once!

Next Steps

At this point your file should be completely formatted, along with all necessary features for the final eBook. The last step is to convert your eBook to the proper formats and check it in an eReader (or eReader application) to make sure everything is kosher. Check the link below for the continuation.

Next: Convert in Calibre / Verification

Shameless promotion: If you want to see how this all looks in final eBook form, download a free sample of my book in Kindle or Nook formats. You could also try reading it as well. ;)

Sunday, October 23, 2011

How to Easily Format an eBook [1] Text Formatting

Last month I published my first eBook on Amazon (Bonebearer). I spent quite a bit of time beforehand making sure that the file met the standards and criteria required by Amazon so it wouldn't get rejected. I read through their formatting guidelines and did a lot of research, but in the end the process I used was very simple and doesn't require any knowledge of HTML or CSS (although it never hurts to know the basics). My process is outlined below for both Kindle and Nook.

All you need to do this is a recent version of Microsoft Word (2007 or higher is recommended) and an eBook format converter like Calibre (which I recommend, it's free and very easy to use). The basic steps are:

1. Text Formatting
2. Title Pages / Table of Contents
3. Convert in Calibre

Each step will be covered in a separate blog post. This tutorial works best when your eBook is just simple text, like a novel. If you're doing something with a lot of pictures or special formatting, this tutorial would help with final conversions, but not with making sure special formatting is done right.

Remember, this is a simple method that works for me. There are obviously different ways to go about this, but hopefully this will help someone.

Text Formatting

I use Microsoft Word for all of my word processing. I read about other popular authors shunning Word and basically saying it sucks, but I've never really understood what exactly their problem with the software is, other than those authors being anti-Windows by principle (Piers Anthony, for example). I use it all the time and have no problems with it. What you can't do with built-in functions, you can always automate using VBA (Visual Basic for Applications).

Anyway, formatting text is easy. There are only a few things you really need to pay attention to. Before you do any of the steps below, though, MAKE A BACKUP COPY OF YOUR ORIGINAL FILE. Never go through this process on your only copy.

The font of your text doesn't make a difference, since Kindle or Nook will ignore the font (the reader controls the font he/she wants to see). When formatting, I switch it to something easy to read, like Times New Roman, 12 pt. The important things you need to address are spacing, tabs, font style, special characters, page breaks (for chapters/sections) and chapter headings. We'll go through each below.

Spacing

Select all the text (excluding title pages and pages that don't have straight text) and change all paragraph spacing to a value of 1.0 and make sure it doesn't add a space before or after each paragraph. I believe this kind of spacing is ultimately ignored, but I like removing it all just in case.

Tabs / Indents

eBooks are generally going to ignore tabs, so if you've got them in your file already, it's best to remove them and replace them with fixed indenting. Even if you don't think you have any tabs in your file, do this anyway just in case. To remove tabs, highlight the entire text, and do a Find & Replace (Ctrl+H). Make sure to click "More" to display more options. A tab character is listed under the "Special" dropdown – select it there for the Find what option, or just type in (^t). Replace with should be blank. Like this:


Select "Replace All" and the tabs go away. Now, you must replace them with indents. As long as you've typed your document like most people do (use word wrap and only line break after each paragraph), this will be easy. Highlight all the text again (excluding title pages, etc, as usual), then just move the "First Line Indent" marker on the ruler (circled in the picture below) over about a half inch (less if you really want, anything larger than 0.5" looks like crap when people read the eBook with large fonts):


Alternatively, you can just go into the Paragraph options in Word and under the Indentation section, make sure Special = "First line" and By = 0.5". Like so:


Font Style (Bold, Italics, etc)

If you type up your document the way you might for a publishing house, where the only font style in the file is underlining (to denote italics in a published book), you should replace it so that what you see in Word is how you want it to display in the eReader. So if you want something italicized, change all instances to italics. A typical novel will only use italics. If you must have something bold (perhaps a chapter header, addressed later), then bold it.

To make these changes, do a simple Find & Replace, as mentioned in the Tab section above. Instead of replacing tab characters, though, you'll be replacing font styles (yes, you can do this in Word... easily). Ctrl+H to get to Find & Replace, select "More" to reveal more options and in the Replace section, use the "Format" dropdown and select "Font" to select the style you need to find or replace.

So in my example, replacing underline with italics: in the Font dialog, the only things you should change are Font style and Underline style.

For Find what, you should have these settings:
   Font style = Regular
   Underline style = Normal underline style, the thinnest unbroken line


For Replace with, you should have these settings:
   Font style = Italic
   Underline style = (none)




Always make sure the Preview window shows the desired look before continuing.  In the end, this is what you want to see in the Find and Replace dialog:


Select "Replace All" and viola, the formatting in your entire document has been changed. Easy.

Special Characters

Another thing you'll want to look out for are things like double en dashes (--) which should be turned into em dashes (—), or the horizontal ellipsis character (...) that Word likes to replace your normal three periods with if you have it set to AutoCorrect.

For double en dashes, these should appear if you were writing in plain text for potential publishing or manuscript submission.  They are easy to fix.  Just do another Find and Replace (make sure the formatting criteria is removed from the last step), type -- for the Find what and for Replace with select the em dash special character in the "Special" dropdown.

For horizontal ellipses, if you typed your manuscript in plain text it shouldn't be a problem, but if it was in your AutoCorrect list, do another Find and Replace.  Copy the horizontal ellipsis character into Find what and type three periods in Replace with.

It's always a good idea to check the AutoCorrect list in the Word Options, to ensure that it doesn't automatically replace things that could be problematic later.  Even better, just turn it off when you're working on your text.

Page Breaks

If your text is broken up into chapters, sections or parts that are clearly demarcated, you should put a page break at the beginning of each. This will help for when you later add a Table of Contents and it just looks better in the eReader when you jump to that chapter or section.

Page breaks are easy to add, just page down through your document and at the spot where the break needs to occur, place the cursor and select Insert -> Page Break in the Word menu. You can also use the shortcut key of Ctrl+Return. Do this for every spot where you want the content to start on a new page: chapter, section, part, etc.



How you want to do it is up to you – logically you'd want it for every chapter or section, like you would find in a professionally published book. If you're publishing an eBook I'm going to assume you like to read, so just reference some books of your own.


Chapter Headings

How you want to do chapter headings (i.e. chapter name) is also up to you, but you should at least format them differently than the main text so that it's obvious that they're chapter headings. There are a couple of different ways you can do them. I suggest you keep it simple – there's no need to go crazy with graphics or any of that, because that just makes for more formatting that could go wrong somewhere along the line.

The simplest way is to do an italicized header, without an indent (my personal preference). If you've set up the fixed indenting throughout your file (as noted in the Tabs / Indents section), then whenever you press Return/Enter (carriage return) the new line will automatically be indented. To remove it, just slide the First Line Indent marker on the ruler back to 0 (opposite of how we created the indents earlier).  If you look back at the second picture in this post, you'll see where the chapter header is not indented, but each paragraph is.

Here's an example of a simple chapter header:

6: The Northwest Fires

Or if you have chapters without names, just do something like:

Chapter 10

If you want to center it, merely use the Center Text option in Word on your selection (or Ctrl+E). The center formatting will carry through to the final eBook.

If you want your chapter header to be partway down the page, place a few carriage returns before the header and put a space or two on each blank line to ensure that the blank line remains. However – don't put too many blank lines before the header, as it may look goofy in a large font on the eReader. Generally this won't be a problem, because I'd wager most people don't read eBooks with gigantic font - and ultimately there's nothing you can do about that - but it doesn't hurt to keep it in mind.

If you want bigger letters or all caps for the first few words (like you sometimes see in a published novel), format your text accordingly. I personally haven't felt the need to do that yet.

Next Steps

At this point the text of your file should be formatted properly. The next step is to add a Table of Contents, along with a Title Page and any other ancillary pages you might need (section / part breaks, copyright info, etc). Check the link below for the continuation.

Next: Title Pages / Table of Contents

Shameless promotion: If you want to see how this all looks in final eBook form, download a free sample of my book in Kindle or Nook formats. You could also try reading it as well.  ;)