1: Getting Started
2: Building Logic
5: Game Mechanics
6: Advanced Topics
7: Testing & Tuning
8: The Last 10%
M1: Mobile - Intro
M2: Mobile - Basics
M3: Mobile - Services
M4: Mobile - Publishing
B: How-To Guides
3.0 Drafts (In Progress)
How to Create Extensions
Extensions are small applications or controls that add new functionality to Stencyl. They serve the same purpose as extensions for web browsers, such as Firefox and Chrome. Extensions allow the community to extend the utility of Stencyl to fit its unique needs, so that the core team can focus on what it does best.
Extensions will appear in Stencyl 1.1. The topics covered in this document include the following:
To develop an extension, you need to know Java and preferably have some working knowledge of Swing or GUI programming. Although we provide an API that makes it simple to build a GUI with no Swing knowledge, knowing it will give you the ability to create more powerful extensions.
As long as the extension has something to do with Stencyl, it's generally doable. What can't be done at this time is extending the Stencyl (Flash) engine, although we have separate plans to tackle that.
Planned extensions that will be officially developed by the Stencyl Team include:
Today, since Extensions can only be accessed from the Extensions menu, this constraints means that extensions that deal with productivity or general use will work the best. Keep that in mind when developing your extension.
Developing an extension is simple, once you master two key concepts: hooks and callbacks.
Hooks determine where your extension is displayed in Stencyl' GUI. For the initial cut, extensions can only appear in the Extensions menu. In the future, we will extend this to the toolbar, Game Center and more.
Callbacks are functions that you implement inside your extension. These are functions that are called at specific times in Stencyl's lifecycle. For example, there are callbacks for when a user opens the app, opens a game, saves a game, and so forth. Every callback is documented at the end of this manual and inside our API docs.
Creating a simple extention takes about half an hour. You will need the following before you begin.
Get the Stencyl Extensions SDK
The SDK consists of a sample project and our API docs for extensions.
You can view the API Documentation here.
Many callbacks exist, in order to provide a wide array of functionality for extensions. Consult the API for the full reference. We're just going to cover the important ones. The majority are named to be self-explanatory.
We provide a set of functions to help you build a GUI or perform common tasks.
showMessageDialog(String title, String text)
doLongTask(final Runnable mainTask, final Runnable onFinish)
setProgressMessage(final String msg)
If you need to store data, use our data API to save out this data to disk. Do not attempt to write out to other locations using the plain Java API's. This will only confuse users, and we'll reject such approaches on the spot.
boolean saveData(String data)
boolean saveDataAsBytes(byte b)
Extensions will be distributed via StencylForge. Unlike other kinds of resources, Extensions will be submitted using a different process and will be manually approved. To do this, you must do two things.
Include the following details in the forum topic.
Please allow several business days for us to review your extension.
Last Updated: 2012-04-05 by Jon
6473 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game, please ask a question on the forums. Thanks!