Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gamebuilderstudio/5240279 to your computer and use it in GitHub Desktop.
Save gamebuilderstudio/5240279 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<panels:BaseComponentPanelUISkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:panels="com.gbs.plugins.views.panels.*"
xmlns:components="com.gbs.gameeditor.common.views.components.*"
width="100%" height="100%">
<!-- host component -->
<fx:Metadata>
[HostComponent("com.gbs.plugins.views.panels.ComponentPanelUIContainer")]
</fx:Metadata>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<panels:states>
<s:State name="disabled" />
<s:State name="normal" />
<s:State name="opened" />
<s:State name="closed" />
</panels:states>
<fx:Script>
<![CDATA[
import com.gbs.plugins.components.CustomGameEngineComponent;
import com.gbs.utils.PluginUtils;
[Bindable]
public var component : CustomGameEngineComponent;
//This is called whenever the component is clicked in the component list
//to show this ui component
override public function updateView():void
{
component = getComponent() as CustomGameEngineComponent;
super.updateView();
}
override protected function panelRemoved(event : Event):void
{
component = null;
super.panelRemoved(event);
}
//This is called frequently by the super.onObjectChanged method
override protected function updateComponentValues():void
{
super.updateComponentValues();
if(!component) return;
//This method will be updated whenever data changes on the game object
//that this component belongs to.
//This is where you update the values of this ui component
if(component.referencePositionOnSpatial) {
positionPRInput.text = component.referencePositionOnSpatial.property;
}
}
]]>
</fx:Script>
<s:Group width="100%">
<s:layout>
<s:VerticalLayout paddingLeft="10" paddingTop="20" paddingRight="10" paddingBottom="10" gap="5" />
</s:layout>
<s:HGroup width="100%" verticalAlign="middle">
<components:PropertyLabel text="Position Reference" styleName="propertyLabel" />
<components:AutoStoreTextInput id="positionPRInput" storeValueFunction="{PluginUtils.updateInputValue}"
storeIn="{component}" storeKey="referencePositionOnSpatial"
inputType="PropertyReference" width="100%"/>
</s:HGroup>
</s:Group>
</panels:BaseComponentPanelUISkin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment