Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Kenney Studio

Easily create your own asset variations using simple to use software! · By Kenney

How to create template files (0.51, not NXT)

A topic by Kenney created Feb 21, 2016 Views: 3,086 Replies: 13
Viewing posts 1 to 6
Developer (14 edits)

This guide will explain the creation of new templates (.ken files) for Kenney Studio. Templates come with a base image plus options to alter the image (changing element colors, shape and size for example).


Requirements:

  • Adobe Animate (or Adobe Flash CS3 and higher) is required to create templates, there is a free trial available.

Step 1. Set-up

Create a new document and draw a base image (i.e. a basic shape, character, item or other object). Make the stage size the exact size of your asset. Create MovieClips (select an element and press F8) for each element that you'd like the user to be able to alter (shape, color, type), give them instance names (see property panel).

Step 2. Declaring the template

Download the latest 'Kenney Studio (development package)' from the Kenney Studio Itch.io page. Included is a file called 'ken.as', copy that file over to where you've saved your template file (FLA). Include it in your project by adding this code to the main timeline frame:

include 'ken.as'

Then declare your template by adding the following values:

info.name       = 'alien';
info.creator    = 'Kenney';
info.version    = 1.0;
info.minVersion = 0.2;

Change info.name to the name of your template, info.creator to your own name and info.version to the version of your template. You can change info.minVersion to require a minimum version of Kenney Studio to open the template with.

Is your template based on a bigger pack of assets? You can add the download URL where users can download the other assets related to your template;

info.download = 'Download URL';

Step 3. Adding options

Now you can add options to your template. The options will be values that the end-user can change in Kenney Studio, like the color or shape of an object. First, add a new category (shows up as a header in Kenney Studio):

addCategory('Category name');

The 'addCategory' function adds a new category, replace 'Category name' with the name of your category.

addOption(graphic, 'frame', 'Option name'); // Set frame of MovieClip
addOption(graphic, 'color', 'Option name', [0xFFFFFF]); // Set color, hex value (0x000000)
addOption(graphic, 'visible', 'Visible'); // Set visible on/off
<span class="redactor-invisible-space">addOption(graphic, 'alpha', 'Transparency', [1]); // Set alpha (0 to 1)
addOption(graphic, 'rotate', 'Rotation');<span class="redactor-invisible-space"> // Rotates the MovieClip</span></span>

The 'addOption' functions adds a new option. The first value is which MovieClip to target, the second one which parameter to change, the third parameter is the name of the option the user will see and the (optional) fourth value gives a default value.

addPin(['position', 'rotation'], graphic1, graphic2);

Use the 'addPin' option to make a MovieClip mimic another MovieClip. This is used for skin colors for example, if the skin color of the head of a character needs to be the same as the arms and legs.

Step 4. Distribution

Publish your document so a SWF file is created, rename the SWF to a .ken document for the sake of making it clear it's a template meant for Kenney Studio.

Hey Kenney,

Are there any plans on having some user-crated assets downloadable somewhere centrally? Not that I have created any, just wondering.

Developer

Yep, if user-created templates get made I'll make sure there's a central place to upload to.

Glad your working on this again. The newest version has come a long way from the 1st alpha. Keep up the great work Kenney! Looking forward to trying out all the new features, and as always ill help spread the word!


Your Friends and Followers,

GreenfordGames Crew

I wanted to know why the need for Adobe Animate (or Adobe Flash CS3)? Could you not use a normal vetor program? I'm basing that on having edited some of the characters from your asset pack 1.

Developer

A normal vector program wouldn't be able to insert the code required to create the templates. To my knowledge, anything that can export an SWF with ActionScript is sufficient though.

After a quick scan the other day, I found a few free programs that can handle the SWF format. I didn't write any down because I'm not there yet, but there were a few.

Here are a few to get you started....

Does this Guide work with Kenney Studio NXT ?

Developer

Nope, for Kenney Studio NXT you won't be able to create anything custom this way - just through the application itself.

(1 edit)

So how do you create custom templates/sprites for the Kenney Studio NXT ? Is it possible to create our custom own templates ? ( not including the ones already included ).

Developer

Just to be clear; There are two things here:

1. In Kenney Studio NXT a 'template' is a file created by users, it contains various elements positioned, scale, rotated and changed.

2. An element is an object from one of the included collections.

Templates can be saved/loaded from within NXT, collections have to be made using Adobe Animate.

(1 edit)

So how do we create and import collections ? Can you create another guide?

Developer

Yes, a new guide will be created after the way of creating collections is finalized. It currently isn't, which would result in me having to rewrite the guide a few times. Concentrating on getting all the main features into the software now, then add some content and then open it up for all to add.

Hi @Kenney, just wondering if there's anything you could share regarding creating collections for Studio NXT at this point? How different is the process compared to the old version of Kenney Studio? Thanks.

Developer

Not yet although the process is pretty much similar, the only exception is that now multiple objects are stored in 1 file. I'll write some documentation regarding this later on.