| |
dragengine:modules:dragonscript:behavior_renderablepanel [2020/09/13 15:09] – created dragonlord | dragengine:modules:dragonscript:behavior_renderablepanel [2024/03/14 16:35] (current) – dragonlord |
---|
Behavior element behavior adding a renderable Panel widget. | Behavior element behavior adding a renderable Panel widget. |
| |
This behavior is useful for models with a complex dynamic texture where the content of the texture is provided by a [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]] widget. Multiple other behaviors can add their content [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Widget.html|Widget]] to the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]] separating logic for reuse. Using **ECBehaviorRenderablePanel** instead of [[behavior_renderablecanvas|ECBehaviorRenderableCanvas]] allows to use the full power of the GUI ToolKit including using [[dragengine:modules:dragonscript:guitheme|Gui Themes]] to create complex content easily. | This behavior is useful for models with a complex dynamic texture where the content of the texture is provided by a #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@# widget. Multiple other behaviors can add their content #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Widget.html,Widget~@# to the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@# separating logic for reuse. Using **ECBehaviorRenderablePanel** instead of [[behavior_renderablecanvas|ECBehaviorRenderableCanvas]] allows to use the full power of the GUI ToolKit including using [[dragengine:modules:dragonscript:guitheme|Gui Themes]] to create complex content easily. |
| |
The default layout for the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]] is [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Layouts_1_1StackLayout.html|StackLayout]]]. The default gui theme is //"/shareddata/guithemes/modern/modern.guitheme.xml"//. The default [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]] designer selector is //"RenderablePanel"//. | The default layout for the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@# is #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Layouts_1_1StackLayout.html,StackLayout~@#]. The default gui theme is //"/shareddata/guithemes/modern/modern.guitheme.xml"//. The default #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@# designer selector is //"RenderablePanel"//. |
| |
To use this behavior add an [[behavior_dynamicskin|ECBehaviorDynamicSkin]] to the element class before adding this behavior. Create **ECBehaviorRenderablePanel** behavior and set the dynamic skin and designer selector and [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1GuiTheme.html|GuiTheme]] for the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]]. Now you can add other behaviors targeting the ECBehaviorRenderablePanel to add [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Widget.html|Widget]] resources to. | To use this behavior add an [[behavior_dynamicskin|ECBehaviorDynamicSkin]] to the element class before adding this behavior. Create **ECBehaviorRenderablePanel** behavior and set the dynamic skin and designer selector and #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1GuiTheme.html,GuiTheme~@# for the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@#. Now you can add other behaviors targeting the ECBehaviorRenderablePanel to add #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Widget.html,Widget~@# resources to. |
| |
The [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Panel.html|Panel]] is created with a default size of 512x512 . You can change the size using the element property to fit the texture requirements. | The #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Panel.html,Panel~@# is created with a default size of 512x512 . You can change the size using the element property to fit the texture requirements. |
| |
====== Instance Counts ====== | ====== Instance Counts ====== |
Size of panel in pixels. | Size of panel in pixels. |
* Full name: "renderablePanel.size" or "renderablePanel(id).size" | * Full name: "renderablePanel.size" or "renderablePanel(id).size" |
* Type: [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Point.html|Point]] | * Type: #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Point.html,Point~@# |
* Default value: (512, 512) | * Default value: (512, 512) |
* Example (*.deeclass): <code xml><point name='renderablePanel.size' x='1024' y='512'/></code> | * Example (*.deeclass): <code xml><point name='renderablePanel.size' x='1024' y='512'/></code> |
====== API Documentation ====== | ====== API Documentation ====== |
| |
[[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Scenery_1_1ECBehaviorRenderablePanel.html|ECBehaviorRenderablePanel]]. | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorRenderablePanel.html,ECBehaviorRenderablePanel~@#. |
| |
Since DragonScript Module Version **1.3** | Since DragonScript Module Version **1.3** |