Royal icing pipes in a soft form and then hardens. There are probably a million recipe variations for royal icing, but the basis is a combination of egg whites and powdered sugar.
Made from dried egg whites, meringue powder can be used in the place of raw egg whites, in royal icing recipe. If you aren't freaked out by the raw whites, the recipe in varying proportions for royal icing consist of raw egg whites, powdered sugar, lemon juice and flavor extract, plus coloring should you want it.
I use gel coloring. It produces much more vibrant colors without watering down the royal icing as you would find with food coloring. Use extracts to flavor your icing. Currently I've been using AZ Bitters Lab Figgy Pudding Bitters to flavor my icing.
Royal icing has to be covered immediately, so that it doesn't dry out. You will even see that if you leave your pastry bag sitting for a bit, your tip will get a crust, dry bit in the tip you will need to clear before continuing. If your bag sits for too long and you are having trouble clear the tip, run it under a bit of hot water and it will clear right out.