Stencyl 3.0 (OpenFL) GUI Extension
This extension is becoming obsolete when 3.1 is available.
With the 3.1 Image API and the keyboard event (Add event -> Input -> Any key) there is no need for a seperate extension anymore.
Both TextField and ListBox behaviors on StencylForge are updated, please use these behaviors instead of this extension.
I will leave this information here for future reference and if anyone still wants to use it.
The GUIDemo on StencylForge is made private!
Previous version was for Stencyl 3.0 November release = non-OpenFL version.
This is the OpenFL version!
Flash Demo
https://dl.dropboxusercontent.com/u/221137130/GUI/GUIDemo.htmlExtension:
https://dl.dropboxusercontent.com/u/221137130/GUI/gui_openfl.zip
Stencyl exported file:
https://dl.dropboxusercontent.com/u/221137130/GUI/GUIDemo.stencyl
Step-By-Step demonstration of Parse and Database Extensions:
https://dl.dropboxusercontent.com/u/221137130/parse/parse_gui_steps.htmlDemo also on StencylForge Download name: GUIDemo
Installation instructions:
As with all extensions you need to put the folder inside the plaf/extension directory from Stencyl.
- Unzip the file in the extension folder
- It will produce a gui folder
- Create a new game
- Goto Settings - Extensions - click on Enable behind GUI
- Stencyl will tell you to close your current game and reopen
- After you have re-opened your Game you will find some blocks in the Custom panel
Basically you have two options to create the GUI Element:
You can either create 'normal' Stencyl Actor with the [create [actor type] ]-blocks or you can create
the elements dynamicly by using the [create actor] custom block. The resulting actor should be stored in
an attribute for future use.
The following step is to make the new actor into a GUI element.
Use the [For [Actor] create -list of elements- X: Y: Width: Height] block.
You can select between the different GUI Elements.
Next you can set properties on the actor. The propertylist works with [anything] blocks and you have to
realize that in that block a textvalue should be enclosed with quotes : "OK"
(Use the 'as number', 'as boolean' for example to make sure that the type matches what you want to achieve)
If you want to retrieve properties you can use the block [For [actor] get property [-property-list-]
For instance the 'Value' of a TextField actor can be retrieved or the 'Selection' of a listbox or radiobutton.
In order to react on Clicks or do when update/draw things there is a [For [actor] on [click/draw] do [trigger]]
block. The trigger can be a scene trigger or an actor trigger. But remember that the trigger fires acros both.
If you have a trigger on your scene level with the same name as in your actor there will be conflicts!!
The extension is in the public domain, to be accessed and modified freely. (Use at your own risk)
Big thanks to Rob1221!
Tested on:
* Flash
* iOS (iPhone 3gs, iPhone 5s, iPad mini)
* Android (Galaxy Tab Note, SII, SIII, Note 2014 Edition)
* Windows Native
* Mac Native
Best regards from
M.E.
May 3rd:
Made obsolete by upcoming 3.1
Edit: for nightly builds round 9 March 2014:
Change GUI.hx :
Line 198:
var _actorType=new com.stencyl.models.actor.ActorType(_typeID,_atlas,_name,_groupID,_spriteID,_behaviorValues,_bodyDef,0,_autoScale,_pausable,_ignoreGravity);
Line 224:
var theActor:com.stencyl.models.Actor=new com.stencyl.models.Actor(engine, 1000+(++engine.nextID),_groupID, _theX,_theY,0,_width,_height,_sprite,_behaviorValues,_actorType,_bodyDef,_isSensor,_isStationary,_isKinematic,_canRotate,_shape,_typeID,_autoScale,_ignorGravity,0);