Switch to Book Layout1: Getting Started2: Building Logic
3: Actors
4: Scenes
5: Game Mechanics6: Advanced Topics7: Testing & Tuning8: The Last 10%M1: Mobile - IntroM2: Mobile - BasicsM3: Mobile - ServicesM4: Mobile - PublishingA: Troubleshooting
B: How-To Guides
C: ReferenceD: Resources3.0 Drafts (In Progress)
|
||
|
Level: Expert
How to Create ExtensionsExtensions 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:
What do you need to know?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.
Can ___ be an extension?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.
Concepts - Hooks and CallbacksDeveloping 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.
Getting Started - How to Create an ExtensionCreating a simple extention takes about half an hour. You will need the following before you begin.
Get the Stencyl Extensions SDKThe SDK consists of a sample project and our API docs for extensions. First Steps
Developing
API DocumentationYou can view the API Documentation here.
Callback ReferenceMany 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.
onStartup()
onActivate()
onDestroy()
onGameSave(Game game)
onGameOpened(Game game)
onGameClosed(Game game)
OptionsPanel onOptions()
onInstall()
onUninstall()
GUI API ReferenceWe 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)
showProgressSpinner()
hideProgressSpinner()
Data API ReferenceIf 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.
String readData()
byte[] readDataAsBytes()
boolean saveData(String data)
boolean saveDataAsBytes(byte[] b)
How to Submit an ExtensionExtensions 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!
0 Comments
Be the first to make a comment! |











